Counting Black
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 10360
Accepted: 6691
Description
There is a board with 100 * 100 grids as shown below. The...
分类:
其他好文 时间:
2014-12-30 17:16:05
阅读次数:
225
Matrix Power Series
Time Limit: 3000MS
Memory Limit: 131072K
Total Submissions: 15997
Accepted: 6840
Description
Given a n × n matrix A and a positive integer k, ...
分类:
其他好文 时间:
2014-12-29 15:24:28
阅读次数:
160
Fibonacci
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9769
Accepted: 6959
Description
In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = F...
分类:
其他好文 时间:
2014-12-29 15:23:38
阅读次数:
107
How many Fibs?
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 10748
Accepted: 3982
Description
Recall the definition of the Fibonacci numbers:
f1 := 1...
分类:
其他好文 时间:
2014-12-29 09:01:26
阅读次数:
155
/*分析:因为他给的数据是递增的 而求得是这些数据总的 最优解所以我们可以考虑,它的子问题求解不影响总的求解 也就是我们可以先求出 第一个的最优解 第二个....以此类推到总的最优解那么我们想如何利用前面一个的最优解推出当前的最优解 考虑这个与背包问题类似 我们在加入当前物品时判断当前加入后...
分类:
其他好文 时间:
2014-12-25 23:21:02
阅读次数:
129
Back to the Past
Time Limit: 2 Seconds
Memory Limit: 65536 KB Special Judge
Recently poet Mr. po encountered a serious problem, rumor said some of his early poems are written by oth...
分类:
其他好文 时间:
2014-12-25 22:07:37
阅读次数:
250
Your boss once had got many copies of a treasure map. Unfortunately, all the copies are now broken to many rectangular pieces, and what make it worse, he has lost some of the pieces.
Luckily, it is...
分类:
其他好文 时间:
2014-12-25 00:15:48
阅读次数:
198
One Person Game
Time Limit: 1 Second
Memory Limit: 32768 KB Special Judge
There is a very simple and interesting one-person game. You have 3 dice, namely
Die1, Die2 and Die3. Die1...
分类:
其他好文 时间:
2014-12-24 18:14:01
阅读次数:
151
题目:给你一个长目标串str,和一些模式串,求每个串出现的次数。模式串有可覆盖和不可覆盖两种。
分析:字符串,多串匹配,AC自动机。由于数据有可能不允许相交,所以记录上一个的结束位置。
题目的数据比较猥琐,可能相同,采用一个 Fath域记录第一次出现的 id,计算一次就可以了。
说明:注意数据有相同的串;该题可以使用 RK算法+二分。
#include
#incl...
分类:
其他好文 时间:
2014-12-23 14:01:51
阅读次数:
210
题目:在火星上有一些原子,他们相互碰撞会释放能量(例如a、b),并且后面的原子会消失(b消失);
现在给你每个原子各一个,问能产生的最大能量值。
分析:状态压缩 DP。按取数的个数为阶段进行 DP,因为与顺序无关,找到下一状态更新即可。
如果只找一条路径,就是 TSP 问题,可将数组变为二维求解。
说明:要不是多组数据,直接位运算+搜索就可...
分类:
其他好文 时间:
2014-12-22 16:19:34
阅读次数:
116