UVA 1541 - To Bet or Not To Bet
题目链接
题意:这题题意真是神了- -,看半天,大概是玩一个游戏,开始在位置0,终点在位置m + 1,每次扔一个硬币,正面走一步,反面走两步,走到的步上有4种情况:
1、向前走n步
2、向后走n步
3、停止一回合
4、无影响
问能在t次机会内,走到终点m + 1(如果跃过也算走到了)的概率,大于0.5,等于0...
分类:
其他好文 时间:
2014-07-18 14:10:34
阅读次数:
207
Not so MobileBefore being an ubiquous communications gadget, a mobile was just a structure made of strings and wires suspending colourfull things. Th....
分类:
其他好文 时间:
2014-07-18 13:34:02
阅读次数:
242
1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int maxn = 1e6; 8 bitset prime; 9 10 void init()11 {12 int ...
分类:
其他好文 时间:
2014-07-18 13:31:49
阅读次数:
261
题目链接:点击打开链接
题意:
一个游戏由3个人轮流玩
每局游戏由其中一名玩家选择一个数字作为开始
目的:获得最小的得分
对于当前玩家 O ,面对 u 这个数字
则他的操作有:
1、 计分 u +1 ,然后 u++;
2、计分 u / x, 然后 u /= x; 其中x为u的因子且x为素数
然后下一个玩家继续上述操作
3个人各操作一次 为1轮
当一轮结束后,若u==1 则游戏...
分类:
其他好文 时间:
2014-07-18 13:28:50
阅读次数:
200
建立两个数组同时存储原学校与目标学校。分别按优先原学校和优先目标学校排序,一一配对,验查是否可行。 1 #include 2 #include 3 using namespace std; 4 5 struct node { 6 int x,y; 7 }a[500010],b[5000...
分类:
其他好文 时间:
2014-07-18 12:29:12
阅读次数:
171
Dropping BallsA number of K balls are dropped one by one from the root of a fully binary tree structure FBT. Each time the ball being dropped first v....
分类:
其他好文 时间:
2014-07-18 12:14:24
阅读次数:
202
下面给出的题目共计560道,去掉重复的也有近500题,作为ACMer Training Step1,用1年到1年半年时间完成。打牢基础,厚积薄发。一、UVaOJhttp://uva.onlinejudge.org西班牙Valladolid大学的程序在线评测系统,是历史最悠久、最著名的OJ。二、《算法...
分类:
其他好文 时间:
2014-07-18 11:39:04
阅读次数:
483
这道题涉及次小生成树,有必要先弄明白次小生成树是怎么一回事。次小生成树,顾名知义。一个定理是,次小生成树可以由最小生成树交换一条边得到。这怎么证明,可以上网搜一下。但有必要提醒的是,交换过来的这样一条边,必须是未成使用过的(即不是最小生成树的边)。而且,交换走的边,必须是已存在的,而且是两点间最短路...
分类:
其他好文 时间:
2014-07-18 10:32:56
阅读次数:
325
BFS,最好先打个质数表。 1 #include 2 #include 3 #include 4 #include 5 //#include 6 const int maxn=15000+5; 7 int s[10]; 8 int vis[maxn],isp[maxn]; 9 us...
分类:
其他好文 时间:
2014-07-18 09:29:37
阅读次数:
231
Double HappinessOn the math lesson a teacher asked each pupil to come up with his own lucky numbers. As a fan of number theory Peter chose prime numbe...
分类:
移动开发 时间:
2014-07-18 00:12:12
阅读次数:
616