ZOJ 3597题意是说有n把枪,有m个靶子,每把枪只有一发子弹(也就是说一把枪最多只能打一个靶子), 告诉你第 i 把枪可以打到第j个靶,现在等概率的出现一个连续的P把枪,在知道这P把枪之后,你被允许选择一个连续的Q个靶子,使得这P把枪所打到的靶子的数目最多,问打到的靶子数目的期望值是多少。这题通...
分类:
其他好文 时间:
2015-05-10 22:16:57
阅读次数:
310
ZOJ 3591Nim(Nim博弈)题目意思是说有n堆石子,Alice只能从中选出连续的几堆来玩Nim博弈,现在问Alice想要获胜有多少种方法(即有多少种选择方式)。方法是这样的,由于Nim博弈必胜的条件是所有数的抑或值不为0,证明见 点击 ,所以答案就转化为原序列有多少个区间的亦或值为0,用n*...
分类:
其他好文 时间:
2015-05-10 20:20:52
阅读次数:
152
G -Cylinder CandyTime Limit:2000MSMemory Limit:65536KB64bit IO Format:%lld & %lluSubmitStatusPracticeZOJ 3866DescriptionEdward the confectioner is mak...
分类:
其他好文 时间:
2015-05-10 20:17:45
阅读次数:
193
一道比较不错的BFS+DP题目题意很简单,就是问一个刚好包含m(m 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include ...
分类:
其他好文 时间:
2015-05-10 20:09:50
阅读次数:
146
题目传送门 1 /* 2 题意:加上适当的括号,改变计算顺序使得总的计算次数最少 3 矩阵连乘积问题,DP解决:状态转移方程: 4 dp[i][j] = min (dp[i][k] + dp[k+1][j] + p[i-1] * p[k] * p[j]) (i 8 #i...
分类:
其他好文 时间:
2015-05-09 18:57:29
阅读次数:
84
一个无向图是弦图当且仅当有一个完美消除序列.
MCS最大势:http://wenku.baidu.com/view/07f4be196c175f0e7cd13784.html
Fishing Net
Time Limit: 10 Seconds Memory Limit: 32768 KB
In a highly modernized fishin...
分类:
Web程序 时间:
2015-05-09 11:51:30
阅读次数:
234
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3696Alien's OrganTime Limit:2 Seconds Memory Limit:65536 KBThere's an alien whose na...
分类:
其他好文 时间:
2015-05-09 11:36:14
阅读次数:
114
在我的电脑上code::blocks运行过不了,但代码是可以AC的,很是郁闷。
问了大神,知道了函数的参数是放在栈区,结构体太大的话,栈就爆了,如是后来就听从大神的意见用引用改写了。
传送门:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1853
#include
#include
#include
int ...
分类:
其他好文 时间:
2015-05-08 22:12:08
阅读次数:
140
Now the God is very angry, so he wants to punish the lazy, greedy humans. He chooses to throw some lines of bricks (just down from the very high Heaven). These days the God lives in a
2D world, so h...
分类:
其他好文 时间:
2015-05-08 16:28:43
阅读次数:
162
Detect the VirusTime Limit:2 Seconds Memory Limit:65536 KBOne day, Nobita found that his computer is extremely slow. After several hours' work, he fin...
分类:
其他好文 时间:
2015-05-08 14:33:52
阅读次数:
155