摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1814题意:n个2人组,编号分别为2n和2n+1,每个组选一个人出来,且给出m条关系(x,y)使得选了x就不能选y,问是否能从每个组选出1人。且输出字典序最小的答案。(n#include #include #inc... 阅读全文
posted @ 2015-03-09 22:42 iwtwiioi 阅读(216) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2829题意:将长度为n的序列分成p+1块,使得$\sum_{每块}\sum_{i#include #include #include #include using namespace std;const int N... 阅读全文
posted @ 2015-03-09 20:15 iwtwiioi 阅读(260) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3480题意:一个n个元素的集合S要求分成m个子集且子集并为S,要求$\sum_{S_i} (MAX-MIN)^2$最小。(n#include #include #include #include using nam... 阅读全文
posted @ 2015-03-09 19:36 iwtwiioi 阅读(289) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1160题意:直线上有n个城市,其中有p个城市有邮局,问如何建p个邮局使得每个城市到最近的邮局和最小。(n#include #include #include #include using namespace std;const int N=100... 阅读全文
posted @ 2015-03-09 18:19 iwtwiioi 阅读(203) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3516题意:平面n个点且满足xiyj, iusing namespace std;const int N=1005, oo=~0u>>1;int d[N][N], x[N], y[N], n, s[N][N];in... 阅读全文
posted @ 2015-03-09 13:26 iwtwiioi 阅读(387) 评论(0) 推荐(0) 编辑