Description Every cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= ...
分类:
其他好文 时间:
2016-06-29 23:44:37
阅读次数:
218
Cow Picnic Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 5432 Accepted: 2243 Description The cows are having a picnic! Each of Farmer Joh ...
分类:
其他好文 时间:
2016-06-29 20:31:44
阅读次数:
140
给定两个整数n和k 通过 n+1或n-1 或n*2 这3种操作,使得n==k 输出最少的操作次数 //广搜,a是队列,step记录步数,vis记录哪些数被搜到过 #include<cstdio> #include<iostream> #define M 1000010 using namespace ...
分类:
其他好文 时间:
2016-06-29 19:02:33
阅读次数:
169
Dining Time Limit: 2000MS Memory Limit: 65536K Description Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and s ...
分类:
其他好文 时间:
2016-06-26 23:58:42
阅读次数:
428
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 29773 Accepted: 12080 Description Every cow's dream is to become the most popu ...
分类:
其他好文 时间:
2016-06-25 15:05:02
阅读次数:
183
描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1616 给出一张图,有些点不能走,给出起始点和结束点,以及时间,求在该时间到达结束点的方案数. 分析 直接DP即可. \(f[i][j][k]\)表示在\(i\)时间走到\((j,k)\)的方案数 ...
分类:
其他好文 时间:
2016-06-23 22:04:47
阅读次数:
171
Milking Time Description Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her ...
分类:
其他好文 时间:
2016-06-21 22:14:45
阅读次数:
116
直接把所有数的sg值算出来就行了。 1 #include<cstdio> 2 #include<iostream> 3 #include<cstring> 4 #include<algorithm> 5 using namespace std; 6 const int maxn=1002333; 7 ...
分类:
其他好文 时间:
2016-06-18 23:59:28
阅读次数:
316
一开始一脸懵逼。。 后来才想到维护一左一右俩指针l和r..表示[l,r]这段内不同种类的数字<=k+1种。 显然最左的、合法的l随着r的增加而不减。 顺便离散化,记一下各个种类数字出现的次数就可以算出答案了。 时间复杂度O(n) 1 #include<cstdio> 2 #include<iostr ...
分类:
其他好文 时间:
2016-06-18 16:41:54
阅读次数:
259
题目: 给定长度为N的字符串S,要构造一个长度为N的字符串T。起初,T是一个空串,随后反复进行下列任意操作。 ·从S的头部删除一个字符,加到T的尾部 ·从S的尾部删除一个字符,加到T的尾部 目标是要构造字典序尽可能小的字符串T。 1 #include "iostream" 2 #include "c ...
分类:
其他好文 时间:
2016-06-17 19:40:08
阅读次数:
245