摘要: 题目链接:http://codeforces.com/problemset/problem/219/D#include#include#include#include#include#includeusing namespace std;const int maxn = 2*1e5+100;int dp[maxn]; //dp[i]表示以i为根遍历全部的点的最小的权值。struct Edge{ int u,v,w; int next; Edge(int u=0,int v=0,int w=0,int next=0): u(u), v(v), w(w), next(next)... 阅读全文
posted @ 2013-09-13 22:34 等待最好的两个人 阅读(229) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#includeusing namespace std;const int maxn = 100;int dp[maxn][maxn]; //dp[i][j]表示以i为根,保留j个点的最大权值。int N,Q;int G[maxn][maxn];int num[maxn]; //以i为根的树的节点个数。//这里处理的时候要注意可以把边的权值压倒儿子节点。void dfs(int u,int fa){ num[u] = 1; for(int v=1;v0;i--){ //相对于下面的V -> 0 ... 阅读全文
posted @ 2013-09-13 21:37 等待最好的两个人 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1332#include#include#include#include#include#includeusing namespace std;const double eps = 1e-8;const double PI = acos(-1.0);const double INF = 1000000000000000.000;struct Point{ double x,y; Point(double x=0, double y=0) : x(x),y(y){ } //构造函... 阅读全文
posted @ 2013-09-13 12:06 等待最好的两个人 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1333#include#include#include#include#include#includeusing namespace std;const double eps = 1e-8;const double PI = acos(-1.0);const double INF = 1000000000000000.000;struct Point{ double x,y; Point(double x=0, double y=0) : x(x),y(y){ } //构造函... 阅读全文
posted @ 2013-09-13 10:13 等待最好的两个人 阅读(167) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#includeusing namespace std;const double eps = 1e-8;const double PI = acos(-1.0);const double INF = 1000000000000000.000;struct Point{ double x,y; Point(double x=0, double y=0) : x(x),y(y){ } //构造函数};typedef Point Vector;Vector operator + (Vector A , ... 阅读全文
posted @ 2013-09-13 00:01 等待最好的两个人 阅读(193) 评论(0) 推荐(0) 编辑