题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3261 题意:有n个星球编号为0—n-1;能量分别为p[i];有m句话,每句话输入a,b表示星球a和星球b可以相通的; 但是由于银河之战,破坏了一些通道 接下来有Q Read More
posted @ 2015-07-27 00:14 西瓜不懂柠檬的酸 Views(277) Comments(0) Diggs(0)
http://poj.org/problem?id=1308#include#include#include#include#include#define N 110#define INF 0xfffffffusing namespace std;int f[N],vis[N];int Find(i... Read More
posted @ 2015-07-26 15:21 西瓜不懂柠檬的酸 Views(133) Comments(0) Diggs(0)
http://acm.hdu.edu.cn/showproblem.php?pid=1272 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define N 100010 7 #define INF 0xfffffff 8 usi... Read More
posted @ 2015-07-26 15:18 西瓜不懂柠檬的酸 Views(130) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=2492 题意是问是否存在同性恋, 就是a喜欢b,b喜欢c,a又喜欢c,所以就有同性恋了; #include<stdio.h> #include<string.h> #include<iostream> #include<algorith Read More
posted @ 2015-07-26 15:13 西瓜不懂柠檬的酸 Views(175) Comments(0) Diggs(0)
http://poj.org/problem?id=1182 题意应该就不用说了 再次回到食物链这道题,自己写了一遍,一直wa...原因竟然是不能用多实例,我也是醉了,但是我真的彻底的理解了,那些关系之间的转化,和上面那道差不多; 这道中的 r[i]表示i和f[i]之间的关系; r[i] = 0,表 Read More
posted @ 2015-07-26 14:47 西瓜不懂柠檬的酸 Views(187) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3038 #include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> #include<math.h> #defi Read More
posted @ 2015-07-26 14:22 西瓜不懂柠檬的酸 Views(133) Comments(0) Diggs(0)
DescriptionNow and then you play the following game with your friend. Your friend writes down a sequence consisting of zeroes and ones. You choose a c... Read More
posted @ 2015-07-26 11:07 西瓜不懂柠檬的酸 Views(235) Comments(0) Diggs(0)
Silver Cow Party Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Silver Cow Party Silver Cow Party Description One cow from each Read More
posted @ 2015-07-22 17:18 西瓜不懂柠檬的酸 Views(289) Comments(0) Diggs(0)
求(Dijkstra算法,求每条路径上的最小值 的最大值)和青蛙的那题类似;#include#include#include#include#include#define INF 0xfffffff#define N 1100using namespace std;int n,m,dist[N],v... Read More
posted @ 2015-07-22 16:06 西瓜不懂柠檬的酸 Views(145) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=3660题意:有n头牛,m个关系,a b意思是a能打败b;求能确定排名的有几个;如果一头牛被x头牛打败,并且可以打败y头牛,如果x+y=n-1,则我们容易知道这头牛的排名就被确定了,所以我们只要将任一头牛,可以打败其他的牛的个数x, 和能... Read More
posted @ 2015-07-22 14:08 西瓜不懂柠檬的酸 Views(261) Comments(0) Diggs(0)
levels of contents