CDOJ 889 Battle for Silver】的更多相关文章

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…
题意:给定一个图,让你找一个最大的子图,在这个子图中任何两点都有边相连,并且边不交叉,求这样子图中权值最大的是多少. 析:首先要知道的是,要想不交叉,那么最大的子图就是四个点,否则一定交叉,然后就暴力就好,数据水,不会TLE的,才100多ms 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <…
B.Battle for Silver 定理:完全图Kn是平面图当且仅当顶点数n<=4. 枚举所有完全图K1,K2,K3,K4,找出最大总权重. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; #define N 100000000 ][]; ]; i…
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 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…
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的节点只需要一个人. 因此,设立…
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…
USACO 2013 NOV SILVER 一.题目概览 中文题目名称 未有的奶牛 拥挤的奶牛 弹簧牛 英文题目名称 nocow crowded pogocow 可执行文件名 nocow crowded pogocow 输入文件名 nocow.in crowded.in pogocow.in 输出文件名 nocow.out crowded.out pogocow.out 每个测试点时限 1秒 1秒 1秒 测试点数目 10 10 10 每个测试点分值 10 10 10 比较方式 全文比较 全文比较…
USACO 2013 DEC SILVER 一.题目概览 中文题目名称 挤奶调度 农场航线 贝西洗牌 英文题目名称 msched vacation shuffle 可执行文件名 msched vacation shuffle 输入文件名 msched.in vacation.in shuffle.in 输出文件名 msched.out vacation.out shuffle.out 每个测试点时限 1秒 1秒 1秒 测试点数目 10 10 10 每个测试点分值 10 10 10 比较方式 全文…