CDOJ 1220 The Battle of Guandu】的更多相关文章

The Battle of Guandu Time Limit: 6000/3000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) In the year of 200, two generals whose names are Cao Cao and Shao Yuan are fighting in Guandu. The battle of Guandu was a great battle and the tw…
The 2015 China Collegiate Programming Contest 2015第一届中国大学生程序设计竞赛 F题 本质就是求单源最短路!注意会爆int 对于每一个村庄i,其实就是花费c[i],把一个人从y[i]转移到x[i]: 如果一张图中,不存在w[i]==2的节点,那么花费肯定是0. 所以,花费就出在w[i]==2的节点上,怎么处理这些节点呢? 可以从w[i]==0的节点上流出一些人,流到w[i]==2的节点上,并且对于每个w[i]==2的节点只需要一个人. 因此,设立…
The Battle of Guandu Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description In the year of 200, two generals whose names are Cao Cao and Shao Yuan are fighting in Guandu. The battle of Guandu was a great battle and the two armies were fighting at…
The Battle of Chibi Time Limit: 6000/4000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Cao Cao made up a big army and was going to invade the whole South China. Yu Zhou was worried about it. He thought the only way to beat Cao Cao is…
给一棵树,如果树上的某个节点被某个人占据,则它的所有儿子都被占据,lxh和pfz初始时分别站在两个节点上,谁当前所在的点被另一个人占据,他就输了比赛,问谁能获胜. Input 输入包含多组数据 每组第一行包含两个数NN,MM(NN,M≤100000M≤100000),NN表示树的节点数,MM表示询问数,N=M=0N=M=0表示输入结束.节点的编号为11到NN. 接下来N−1N−1行,每行22个整数AA,BB(1≤A1≤A,B≤NB≤N),表示编号为AA的节点是编号为BB的节点的父亲. 接下来MM…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5545 题意:有N个村庄, M 个战场: $ 1 <=N,M <= 10^5 $; 其中曹操会从第i个村庄中选出若个人 在x[i]战场为其作战, 同时第i个村庄也会有相同的人数在y[i]战场为袁绍作战: 每个战场i 有对应的重要度w[i],w[i]的值为 0,1,2: w[i]为2的战场,要求曹操的兵数(从村庄得到的) 严格大于 袁绍的兵的数量: w[i]为1的战场,曹操的兵数不少于袁绍的兵即可:…
Battle for Silver Time Limit: 2999/999MS (Java/Others)     Memory Limit: 65432/65432KB (Java/Others) Piet Hein was a Dutch naval officer during the Eighty Years' War between the United Provinces of The Netherlands and Spain. His most famous victory w…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…
D. Sea Battle time limit per test: 1 second memory limit per test :256 megabytes input: standard input output: standard output Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships…
http://lightoj.com/volume_showproblem.php?problem=1220 题目大意: 给你一个x,求出满足 x=b^p, p最大是几. 分析:x=p1^a1*p2^a2*...*pn^an; p最大是gcd(a1,a2,...,an). ///他该诉你x,b,p都是整数,所以x,b有可能是负数.当x是负数时,p不能是偶数. #include<stdio.h> #include<string.h> #include<stdlib.h>…