自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(62)
  • 收藏
  • 关注

原创 Codeforces - 501 - div3 - Bracket Substring (KMP + DP)

Codeforces - 501 - div3 - Bracket Substring (KMP + DP)题目链接:http://codeforces.com/contest/1015/problem/F题意: 给你一个 nnn 和一个字符串 sss 问:构造一个长度为 2∗n2∗n2 * n 并包含 sss 的字符串的构造方法输入:5()))()3((...

2018-08-02 17:15:48 298

原创 Codeforces - 455 - div. 2 - C - Python Indentation - DP

题目链接:http://codeforces.com/contest/909/problem/C题意:python 语言有两种语句,simple 语句( s 语句)和 for 语句( f 语句)。其中 for 语句的循环体需要缩进一格,并且不能为空( for 语句的循环体里至少有一个 s 语句或 for 语句)。给出 n 条语句,问总共有多少种合法的缩进方法。输入:4sf...

2018-07-31 15:34:16 196

原创 AtCoder-C-String Coloring(字符串)

题意:输入 nnn 和 字符串 sss ,代表 字符串 sss 的长度为 2∗n2∗n2 * n 正着选 nnn 个字符构成一个字符串 s1s1s1 ,然后倒着选 nnn 个字符构成一个字符串 s2s2s2 ,不能选重复的字符。问:字符串 s1s1s1 与 字符串 s2s2s2 完全一样的的方案数是多少?数据范围:1<=n<=181<=n...

2018-07-15 21:06:30 473

原创 HDU-4790-Just Random(数学)

HDU-4790-Just Random(数学)题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4790题意:先输入一个 TTT ,代表有 TTT 组数据然后输入 aaa , bbb , ccc , ddd , ppp , mmm 问:在区间 [a,b][a,b][a,b] 和 [c,d][c,d][c,d] 中分别挑...

2018-07-12 16:52:24 421

原创 HDU-4821-String(哈希)

HDU-4821-String(哈希)题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4821题意:输入一个 mmm 和 lll 再输入一个字符串 sss 问:在 sss 串有多少个子串满足以下条件(1)该子串的长度为 m∗lm∗lm * l (2)该子串被分为连续的 mmm 块长度为 lll 的子串,且每块子...

2018-07-12 16:51:43 289

原创 拓扑排序模板

#includeusing namespace std;const int maxn = 1e4 + 5;vector G[maxn];int in[maxn],seq[maxn];int n,m,cnt = 0;void topology(){ for(int i = 1;i <= n;i++){ if(in[i] == 0) seq[++cnt] = i

2018-07-08 15:33:12 188

原创 去重全排列

n! / (num(a1)! * num(a2)! … n:代表长度 ai:代表种类的个数

2018-07-08 15:21:40 536

原创 Codeforces-336-div2-D-Zuma

题目链接:Go!题目大意:​ 给你一个长度为 nnn 的序列 ccc,每次操作删去当前序列的一个回文串。问:把序列全部删完,最少需要多少次的操作?数据范围:1≤n≤1051≤n≤1051 \leq n \leq 10^51≤ci≤n1≤ci≤n1 \leq c_i \leq n样例:inputinputinput31 2 1...

2018-04-17 11:06:14 77

原创 Codeforces911D---Inversion Counting

题目大意:给你 nnn 个数,和 mmm 个操作询问,每个询问给你 l,rl,rl,r 两个数,问你反转 l,rl,rl,r 区间的元素后,整个序列的逆序对的个数是奇数个还是偶数个,奇数个输出 oddoddodd ,偶数个则输出 eveneveneven ,该逆序对以从小到大为标准次序,反转后不会恢复为原序列,且保证 nnn 个数中每个数都不相同。数据范围1≤n≤150...

2018-04-17 11:05:33 203

原创 POJ-1141-Brackets Sequence

题目链接:Go!题目大意:​ 给你一个长度不超过 100100100 且只包含 (,),[,](,),[,]( , ) , [ , ] 四种字符的字符串 sss,添加 最少 的字符使其变成一个合法的字符串,输出这个合法的字符串。合法字符串的定义:EmptyEmptyEmpty sequencesequencesequence isisis ...

2018-04-17 11:04:23 186

原创 优先队列

从大到小:priority_queue&lt;int,vector&lt;int&gt;,less&lt;int&gt;&gt;p;priority_queue&lt;int,vector&lt;int&gt;,less&lt;int&gt;&gt;p;priority\_queue p;从小到大:priority_queue&lt;int,vector&lt;int

2018-04-17 11:03:24 185

原创 马拉车

一.算法过程分析由于回文分为偶回文(比如 bccbbccbbccb)和奇回文(比如 bcacbbcacbbcacb),而在处理奇偶问题上会比较繁琐,所以这里我们使用一个技巧,在字符间插入一个字符(前提这个字符未出现在串里)。举个例子:s="abbahopxpo",转换为s_new="$#a#b#b#a#h#o#p#x#p#o#"(这里的字符 $ 只是为了防止越界,下面代码会有说明)...

2018-04-17 11:02:57 387

原创 Dijkstra

#include &lt;cstdio&gt;#include &lt;cstring&gt;#include &lt;cstdlib&gt;#include &lt;algorithm&gt;#include &lt;cmath&gt;#include &lt;queue&gt;#include &lt;set&gt;#include &lt;map&g

2018-04-17 11:02:20 172

原创 CF - div2 - 460 - D.Substring(拓扑排序 + DP)

D. Substring time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given a graph with n nodes and m directed edges. One lowercase lette...

2018-03-08 12:45:43 256

原创 CF - 286 - div2 - C - Mr. Kitayuta, the Treasure Hunter (DP)

The Shuseki Islands are an archipelago of 30001 small islands in the Yutampo Sea. The islands are evenly spaced along a line, numbered from 0 to 30000 from the west to the east. These islands are know...

2018-03-06 09:45:50 200

原创 AT - Grand - 004 - B - Colorful Slimes(思维理解)

B - Colorful Slimes Time limit : 2sec / Memory limit : 256MBScore : 400 pointsProblem Statement Snuke lives in another world, where slimes are real creatures and kept by some people. Slimes come...

2018-02-12 21:19:04 811

原创 寒武纪重现(HDU)- 1008(6261) - Rikka with Mutex(二分 + 错误总结)

Rikka with Mutex Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others) Total Submission(s): 32 Accepted Submission(s): 12Problem Description Sometimes, technica...

2018-02-08 20:23:05 730

原创 AtCoder - Petrozavodsk - Contest - 001 - D (缩点 + 贪心 + 错误总结)

D - ForestTime limit : 2sec / Memory limit : 256MBScore : 600 pointsProblem Statement You are given a forest with N vertices and M edges. The vertices are numbered 0 through N−1. The edges are

2018-02-06 20:40:37 571

原创 CF - div2 - 459 - C - The Monster

C. The Monstertime limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output As Will is stuck in the Upside Down, he can still communicate with his mom,

2018-01-30 22:02:19 661

原创 ZOJ - 3769 - Diablo III (分组背包 ,dp)

Diablo IIITime Limit: 2 Seconds Memory Limit: 65536 KB Diablo III is an action role-playing video game. A few days ago, Reaper of Souls (ROS), the new expansion of Diablo III, has been release

2018-01-30 14:23:56 487

原创 POJ - 1170 - Shopping Offers(状压dp)

Shopping OffersTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 5333 Accepted: 2242 DescriptionIn a shop each kind of product has a price. For example, the price of a flower i

2018-01-27 14:24:06 306

原创 HDU - 2159 - FATE(完全背包)

FATETime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 16395 Accepted Submission(s): 7698Problem Description 最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备

2018-01-25 15:46:39 183

原创 HDU - 2844 - Coins (多重背包,dp)

CoinsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 17216 Accepted Submission(s): 6809Problem Description Whuacmers use coins.They ha

2018-01-24 23:29:37 202

原创 HDU-2955-Robberies(01背包,逆向思维)

RobberiesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 27026 Accepted Submission(s): 9959Problem Description The aspiring Roy the Ro

2018-01-24 12:48:33 245

原创 HDU - 1864 - 最大报销额 (浮点数 ,一维dp)

最大报销额Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 28554 Accepted Submission(s): 8789Problem Description 现有一笔经费可以报销一定额度的发票。允许报销的发票类型

2018-01-22 15:01:02 353

原创 3461. 在哈尔滨的寒风中(找规律)

Time limit per test: 1.0 seconds Memory limit: 256 megabytes kblack 来到了寒冬中的哈尔滨,哈尔滨的寒风令 kblack 瑟瑟发抖。世界上最远的距离,是你与宾馆只差一条冰街,而你却忘了穿上秋裤。kblack 终于冲进了宾馆,宾馆大厅的地板铺满了五颜六色的地砖,可以被看作是一块 n×m 格的棋盘,为了能使冻僵了的双脚尽快暖和起来,k

2017-12-08 23:23:15 389

原创 D. Almost Identity Permutations(dp)

D. Almost Identity Permutations time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output A permutation p of size n is an array such that every inte

2017-11-17 20:40:06 636

原创 2017中国大学生程序设计竞赛-哈尔滨站 (B.尺取 + 二分)

Problem Description Alice are given an array A[1..N] with N numbers.Now Alice want to build an array B by a parameter K as following rules:Initially, the array B is empty. Consider each interval in ar

2017-11-16 12:05:59 614

原创 dfs序

#include<bits/stdc++.h>using namespace std;const int maxn = 1e5 + 5;vector<int>G[maxn];int in[maxn],out[maxn],d[maxn];int tot = 0;void dfs(int x,int pre,int deep){ in[x] = ++tot; d[x] = deep

2017-10-13 20:34:03 206

原创 Problem G. Rectangular Polygon(dp + 转移重现)

2006-2007 Winter Petrozavodsk Camp, Andrew Stankevich Contest 23 (ASC 23)Problem G. Rectangular Polygon Input file: polygon.in Output file: polygon.out Time limit: 1 second Memory limit: 64 megabyt

2017-10-13 20:30:56 403

原创 内存分析

1比特(bit) = 0.125字节(b) 1千字节(kb) = 1024字节(b) 1兆字节(mb) = 1048576字节(b)32位编译器: char :1个字节 int: 4个字节 unsigned int : 4个字节 float: 4个字节 double: 8个字节 long lon

2017-10-07 11:43:49 178

原创 位运算总结

一. 按位 ”与“运算(&) and①.同为“1”为“1”。②.负数按补码形式参加按位”与“运算。③.”与“运算的特殊用途: *清零。x & 0 = 0。*取一个数中指定位 例如: x = 100101101while(x){ if(x & 1) cout << 1 << ' '; else cout << 0 << ' '

2017-10-06 11:38:42 190

原创 B. Preparing for Merge Sort(二分)

2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest, qualification stage (Online Mirror, ACM-ICPC Rules, Teams Preferred)B. Preparing for Merge Sort time limit per test2 seconds memory limit per

2017-09-21 21:25:23 532

原创 spfa模板

#includeusing namespace std;const int maxn = 1e4 + 5;int inf = 1e9 + 7;vector G[maxn],cost[maxn];queue seq;int n,m,dis[maxn],vis[maxn];void spfa(int x){ for(int i = 1;i <= n;i++) dis[i]

2017-09-15 21:46:43 158

原创 At.beginner.073 D - joisino's travel (floyd + 全排列)

D - joisino’s travel Time limit : 2sec / Memory limit : 256MBScore : 400 pointsProblem Statement There are N towns in the State of Atcoder, connected by M bidirectional roads.The i-th road connects T

2017-09-15 20:52:57 266

原创 2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 F.islands (强联通分量 + 缩点)

On the mysterious continent of Tamriel, there is a great empire founded by human.To develope the trade, the East Empire Company is set up to transport goods from place to place.Recently, the company wa

2017-09-14 22:26:03 320

原创 hdu -- 6105 -- Gameia(博弈)

GameiaTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1006 Accepted Submission(s): 428Problem Description Alice and Bob are playing a game

2017-08-11 22:27:40 270

原创 hdu -- 6098 -- Inversion(排序)

InversionTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 221 Accepted Submission(s): 150Problem Description Give an array A, the index star

2017-08-11 15:24:03 187

原创 平常水题 Educational Codeforces Round 26 C (错误总结)

平常水题 Educational Codeforces Round 26 CC. Two Seals time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output One very important person has a pie

2017-08-04 15:08:01 306

原创 组合数学

组合数学一. C a 取 b long long slove(int x,int y){ long long sum=1; int tot= max(x- y,y); for(int i = x;i>= tot+1;i–) sum =(sum* i)/(x- i+1); ret

2017-08-04 15:00:07 457

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除