摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4750代码:#include#include#include#includeusing namespace std;const int maxn = 10005;const int maxm = 500500;struct Edge{ int u,v,w; Edge(int u=0,int v=0,int w=0): u(u), v(v), w(w) {} bool operator >n>>m) { for(int i=0; i<n; i++) ... 阅读全文
posted @ 2013-10-01 22:45 等待最好的两个人 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4882代码:#include#include#include#include#includeusing namespace std;const int maxn = 200005;struct Edge{ int u,v,w; Edge(int u=0,int v=0,int w=0): u(u), v(v), w(w) {} bool operator rhs.w; }}edges[maxn];int counts[maxn];int p... 阅读全文
posted @ 2013-10-01 20:37 等待最好的两个人 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4879代码:#include#include#include#include#includeusing namespace std;const int maxn = 550;struct Two_Sat{ int n; vector G[maxn*2]; bool mark[maxn*2]; int s[maxn*2],cnt; void init(int n) { this->n = n; memse... 阅读全文
posted @ 2013-10-01 12:06 等待最好的两个人 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3678代码:#include#include#include#include#includeusing namespace std;const int maxn = 1050;struct Two_Sat{ int n; vector G[maxn*2]; bool mark[maxn*2]; int s[maxn*2],cnt; void init(int n) { this->n = n; memset(mark,0,sizeof(mark)); f... 阅读全文
posted @ 2013-10-01 10:42 等待最好的两个人 阅读(177) 评论(0) 推荐(0) 编辑