摘要: 只有20个点,从大到小排序然后枚举即可。这里做了一个优化,不模大于自己的数,因为这是徒劳的,我们要求的是最小的r。注意:不排序就枚举是错误的,想一想,为什么。 1 #include 2 #include 3 #include 4 #include 5 using namespace std;... 阅读全文
posted @ 2015-08-03 18:49 hxy_has_been_used 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 理清逻辑关系即可。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int N = 1000; 8 const int M = 5000000; 9 int head... 阅读全文
posted @ 2015-08-03 17:09 hxy_has_been_used 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题意有点模糊,其实是这样的:对于每一个队伍,队长和其余两人(视为整体)至少留下一个,且不能同时留下;对于每一对队员,A留下则B不能留下,B留下则A不能留下。建图求解即可,不过还是想吐槽一下出题人的中文,o(╯□╰)o,请叫我建边小王子。 1 #include 2 #include 3 #i... 阅读全文
posted @ 2015-08-03 16:27 hxy_has_been_used 阅读(172) 评论(0) 推荐(0) 编辑