ZOJ 3329 One Person Game(概率dp求期望)...
分类:
其他好文 时间:
2015-02-05 15:04:17
阅读次数:
130
题目链接:
3103
题意:
一块N X M 的墙壁,求从S点出发 到T点的最短时间 每次只能爬一步,且只能左右脚交替爬行,墙上每个方块中的数字标明方块的"光滑
等级",标有数字t 的方块将花费他t 个单位时间安全地将他的脚踏在上面。
题解:
队列结构体中有4个变量(x,y,步数,固定的脚(0左脚,1右脚))。将所有s点...
分类:
其他好文 时间:
2015-02-05 09:38:29
阅读次数:
117
Painting StoragesTime Limit:2 Seconds Memory Limit:65536 KBThere is a straight highway withNstorages alongside it labeled by1,2,3,...,N. Bob asks you ...
分类:
其他好文 时间:
2015-02-05 00:38:04
阅读次数:
148
zoj 3041 City Selection(数学啊)...
分类:
其他好文 时间:
2015-02-04 20:29:39
阅读次数:
149
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4808
Background
If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall...
分类:
其他好文 时间:
2015-02-04 18:37:27
阅读次数:
154
题目大意:
There is a very simple and interesting one-person game. You have 3 dice, namely
Die1, Die2 and Die3. Die1 has
K1 faces. Die2 has
K2 faces. Die3 has
K3 faces. All the dice are fair dice, so ...
分类:
其他好文 时间:
2015-02-04 16:37:11
阅读次数:
158
这题用的是贪心算法,不过在贪心之前还是要进行部分处理的。
首先就是题目要求B/P尽可能的大,所以P应该尽可能的小,B应该尽可能的大。但是B和P的处理方式是不一样的,B是所有带宽中最小的那一个,P是所有设备的总价钱,所以我能想到一个方法就是一个一个的枚举B,本来我是不敢这样想的,可是题目给的时间比较长,我觉得应该问题不大,当我运行之后,竟然只是0ms,让我吃了一惊。然后再选择设备,这时候就要用到贪...
分类:
其他好文 时间:
2015-02-04 09:31:34
阅读次数:
160
题意:S[n]与所有S[i](i互质,则为Prime S。求(S[n]/X)%M;
思路:由集合性质推得S[i+1]=S[i]+S[i-1],则S[i]是斐波那契数。从第五项开始,每项斐波那契为质数的条件为当且仅当它的项数为质数,因此采用素数打表的方法得到第k个Prime S的斐波那契数的项数。然后用矩阵乘法求出第k个S的值对应的下一个斐波那契数,然后枚举该斐波那契数,直到能被X整除。
#in...
分类:
其他好文 时间:
2015-02-03 13:20:17
阅读次数:
150
//poj 3666//分析:只是在2005年集训队论文黄源河提到的题目上略微有一点点变化 1 #include"iostream" 2 #include"cstdio" 3 using namespace std; 4 const int maxn = 2100; 5 int v[maxn],l[...
分类:
其他好文 时间:
2015-02-02 22:45:30
阅读次数:
372
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1314The terrorist group leaded by a well known international terrorist Ben Bladen is b...
分类:
其他好文 时间:
2015-02-02 17:19:35
阅读次数:
161