02 2015 档案
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2115题意:给出一个n个点m条边的无向连通边加权图,求1~n的某条路径使得异或值最大(可以重复点可以重复边)(nusing namespace std;const int N=50005, M=1000...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1115题意:n堆石子,个数是从左到右单增。每一次可以从任意堆取出任意石子,但要保持单增这个性质。问先手是否必胜(nusing namespace std;int n, a[1005];int main(...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3093题意:n个球(红和蓝两种),等概率有1~n个红球。首先取出p个球且这p个球里边有q个红球,问从剩下的球里边取一个红球的概率(nusing namespace std;int main() { in...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4418题意:一个0~n-1的坐标轴,给出起点X、终点Y,和初始方向D(0表示从左向右、1表示从右向左,-1表示起点或终点),在走的过程中如果到达起点或终点,那么下一步往反方向走。每次可以走1~m步,每步概率为p[i...
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3957题意:m个位置,每个位置填1~n的数,求至少有L个位置的数一样的概率(1#include #include using namespace std;struct inum {...
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3754题意:有三个色子,分别有k1、k2、k3个面,权值分别是1~k1, 1~k2, 1~k3,等概率朝上。如果朝上的面分别为a、b、c,则分数置0,否则累加权值和。当权值和>n时...
阅读全文
摘要:http://codeforces.com/problemset/problem/148/D题意:w个白b个黑,公主和龙轮流取,公主先取,等概率取到一个。当龙取完后,会等概率跳出一只。(0using namespace std;int n, m;const int N=1005;double d[N...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4089题意:有n个人排队等着在官网上激活游戏。主角排在第m个。对于队列中的第一个人。有以下情况:1、激活失败,留在队列中等待下一次激活(概率为p1)2、失去连接,出队列,然后排在队列的最后(概率为p2)3、激活成功...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4336题意:n张卡片,每一次取一个盒子,盒子里装有卡片i的概率是p[i],求得到所有卡片所需要开的盒子的期望数(n#include using namespace std;const int N=22;int n;...
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4808题意:一个吸血鬼初始攻击力为f。n条路,他每次等概率选择一条路。如果攻击力大于这条路的c[i],则花费t[i]天逃出($t[i]=\frac{1+\sqrt{5}}{2} \...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4035题意:给一棵n个节点的树,每个节点有值k[i]和e[i],分别表示k[i]概率走向1号节点,e[i]概率获得胜利(即停止),如果没有进行上边任意操作,则等概率的走向与这个节点连边的点。问走过的边的期望。(n#...
阅读全文
摘要: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题意:(前两个问略...)第三个问是,求ax≡b(modp)最小的x,或者输出无解,它们范围都是109哒= =#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...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1846题意:二人博弈,1堆石子每次取1~m个,没有石子可取的输,输出先手胜利还是后手胜利。#include using namespace std;int main() { int c; scanf("%d", &...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1406题意:求$0using namespace std;typedef long long ll;set s;int main() { ll n; scanf("%lld", &n); for(int...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2456题意:给一个$n#include int main() { int n, now, tot=1, i, t; scanf("%d%d", &n, &now); for(i=1; i<n; ++i)...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3834题意:求$max\{(i,j)\}, sminusing namespace std;int main() { int cs, smin, smax, wmin, wmax, ans; scanf...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3434 题意:n维坐标中要找c个点使得c个点在一条线上且每一维的坐标单调递增且不能超过每一维限定的值m[i](n<=11, 2<=c<=20, m[i]<=100000) #include <bits/
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2693题意:求∑ni=1∑mj=1lcm(i,j), n,m≤1e7, 多个询问q≤10000#include using name...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2154题意:求∑ni=1∑mj=1lcm(i,j), $n,musing namespace std;typedef long long ll;const ...
阅读全文
摘要:题意:求$$\sum_{i=1}^{n} \sum_{j=1}^{m} \sum_{d|(i, j)} d 且 (\sum_{d|(i, j)} d)using namespace std;const int N=1e5+10, MN=1e5, YU=(1uMN) break; np[t]=1;...
阅读全文
摘要:题意:给定一个长度为n的序列,m次询问,每次询问一个区间[l, r],求max(Ai xor Ai+1 xor Ai+2 ... xor Aj),其中lusing namespace std;const int nT=5000005, N=12005;struct node *null;struct...
阅读全文
摘要:妈呀...发现不发博文公布自己要学的东西压力少太多了..........然后就会变得颓废.....................求大家监督QAQ....To Do List是近3天左右目标,3天一更.............(而不是一大版一大版的.............ps:做完了的都已经打上透...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3065题意:带插入、修改的区间k小值在线查询。(原序列nusing namespace std;const int nTr=1000005, nSg=15000005, alphaA=4, alphaB...
阅读全文