随笔分类 - 生活-OI
摘要:http://acm.sgu.ru/problem.php?contest=0&problem=495题意:N个箱子M个人,初始N个箱子都有一个礼物,M个人依次等概率取一个箱子,如果有礼物则拿出礼物放回盒子,如果没有礼物则不操作。问M个人拿出礼物个数的期望。(N,Musing namespace s...
阅读全文
摘要:http://poj.org/problem?id=2151题意:T个队伍M条题目,给出每个队伍i的每题能ac的概率p[i][j],求所有队伍至少A掉1题且冠军至少A掉N题的概率(T#include using namespace std;const int T=1005, M=35;double ...
阅读全文
摘要:http://poj.org/problem?id=3071题意:2^n支队伍进行淘汰赛,每一轮都是第一个与第二个,第三个与第四个比赛,给出了这些人之间的胜率,赢了的进入下一轮,相对位置不变。一共n轮比赛。问哪支队伍n轮比赛后的胜率最大。(nusing namespace std;const int...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3853题意:n×m的格子,起始在(1,1),要求走到(n,m),在每一格(i,j)有三种走法,其中p[i,j,0]的概率留在原地,p[i,j,1]的概率走到(i,j+1),p[i,j,2]的概率走到(i+1, j)...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4405题意:每次可以走1~6格,初始化在第0格,走到>=n的格子就结束。还有m个传送门,表示可以从X[i]格传送到Y[i]而不需要消耗次数,X[i]#include using namespace std;doub...
阅读全文
摘要:http://poj.org/problem?id=2096题意:s个系统n种bug,每天找出一个bug,种类的概率是1/n,系统的概率是1/s。问:每个系统至少找出一个bug;每种类的bug都被找出。的期望天数(0using namespace std;double d[1005][1005];i...
阅读全文
摘要:http://poj.org/problem?id=3744题意:直线上n个地雷,n#include #include using namespace std;typedef double mtx[2][2];void mul(mtx &a, mtx &b, mtx &c) { static mtx...
阅读全文
摘要:http://poj.org/problem?id=2420题意:给n个点,求一个点使得到这个n个点的距离和最短,输出这个最短距离(n#include #include #include using namespace std;const int N=5005;struct P { int x, y...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1006题意:在一个弦图中找最少染色数。(nusing namespace std;const int N=10005, M=1000005;int n, m, ihead[N], tag[N], cnt...
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1015题意:给出一个n个点的无向图,询问是否为弦图,弦图定义为对于图中任意长度>3的环一定存在环上不相邻的点有边相连(nusing namespace std;const in...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3239题意:原题很清楚了= =#include using namespace std;map s;typedef long long ll;int mpow(int a, int b, int p) ...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2242题意:(前两个问略...)第三个问是,求$a^x \equiv b \pmod{p}$最小的$x$,或者输出无解,它们范围都是$10^9$哒= =#include using namespace ...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2194题意:求$c[k]=\sum_{kusing namespace std;struct cp { double x, y; cp(double _x=0, double _y=0):x(_x),y...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2157题解:裸lct不解释..#include using namespace std;struct node *null;struct node { node *c[2], *f; bool flag...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2147题意:n×m的棋盘,每次可以向左走、向下走、向左下走,初始在(1, m),n,musing namespace std;int main() { int n, m; while(scanf("%d%d", &...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1517题意:每次乘上2~9。。p>=n时赢..#include #include #include using namespace std;typedef long long ll;map h;ll n;bool ...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1850题意:同nim...顺便求方案数...#include #include using namespace std;int a[105];int main() { int n; while(scanf("%d"...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1536题意:同nim...多堆多询问...单堆n#include using namespace std;bool b[105];int s[105], f[10005];int main() { int k, m...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1848题意:同nim,3堆,每次取的为fib数,n#include using namespace std;int f[1005], a[100];bool b[20];int main() { a[1]=1; a...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1847题意:同nim..不过只有一堆..每次取2的幂次..即1、2、4....等,n#include using namespace std;int f[1005];int dfs(int n) { if(n==0...
阅读全文

浙公网安备 33010602011771号