博弈论里面一个非常重要的结论:如果前一个状态所有可能都是必败态,那么当前状态一定是必胜态。如果前一个状态所有可能有一个是必胜态,那么当前状态一定是必败态。POJ 2484 A Funny Game博弈游戏里面后手经常占据优势。除了A可以一次性全部拿光的情况,其他时候B都可以采取与A相同的策略,这样每...
分类:
其他好文 时间:
2014-07-21 23:30:20
阅读次数:
292
题目来源:POJ 2185 Milking Grid
题意:至少要多少大的子矩阵 可以覆盖全图
例如样例 可以用一个AB 组成一个
ABABAB
ABABAB 可以多出来
思路:每一行求出周期 总共n个 求这n个周期的最小公倍数 如果大于m 取m
每一列求出周期 总共m个求这个m个周期的最小公倍数 如果大于n取n
答案就是2个最小公倍数的积
#inc...
分类:
其他好文 时间:
2014-07-21 23:29:43
阅读次数:
302
Building Roads
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 8999
Accepted: 2596
Description
Farmer John had just acquired several new farms! He wants to...
分类:
其他好文 时间:
2014-07-21 23:29:43
阅读次数:
232
Bad Cowtractors
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 10194
Accepted: 4333
Description
Bessie has been hired to build a cheap internet network am...
分类:
其他好文 时间:
2014-07-21 23:28:09
阅读次数:
260
Network
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 13260
Accepted: 5119
Special Judge
Description
Andrew is working as system administrator and is...
分类:
Web程序 时间:
2014-07-21 23:27:31
阅读次数:
277
POJ 1159 Palindrome && HDU 1159 Common Subsequence...
分类:
其他好文 时间:
2014-07-21 23:27:29
阅读次数:
249
差分约束
题意倒是简单,难的是建立约束(建边)。可以初始化INF求最小,然后输出-dis[maxn]。也可以初始化-INF求最大,输出dis[maxn]。
求最大的时候:
minn为最小,maxn为最大。
输入 u ,v len 建立约束为 u->v = len,最后在 minn和maxn之间还要建立 i->i-1=-1 , i-1->i=0。
最后求minn-1 ~max...
分类:
其他好文 时间:
2014-07-21 22:43:47
阅读次数:
293
Description
The cows have a line of 20 water bowls from which they drink. The bowls can be either right-side-up (properly oriented to serve refreshing cool water) or upside-down (a position which h...
分类:
其他好文 时间:
2014-07-21 22:32:18
阅读次数:
278
次最短路。
题意简单,无向图求次最短路。
起点,终点分别做一个SPFA。 然后 d1[u] + w[u,v] +d2[v] 就是经过此边的最短路。 只要排除掉最短,然后比较再找最短。
就是总的次短路。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#incl...
分类:
数据库 时间:
2014-07-21 22:27:07
阅读次数:
272
Sum of Consecutive Prime Numbers
Description
Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive ...
分类:
其他好文 时间:
2014-07-21 22:18:12
阅读次数:
222