摘要: 又是一道树上做分组背包的题目... 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int INF = 999999999; 7 const int N = 2001; 8 int value[N]; 9 i... 阅读全文
posted @ 2015-08-01 20:33 hxy_has_been_used 阅读(138) 评论(0) 推荐(0)
摘要: 最基本的在DAG上求最短路。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int INF = 999999; 7 const int N = 100001; 8 int dp[N]; 9 10 int m... 阅读全文
posted @ 2015-08-01 20:25 hxy_has_been_used 阅读(225) 评论(0) 推荐(0)
摘要: 思路:记答案为ans,统计出数列A和B在某二进制某一位上有多少个1,如果个数相同,则ans那一位上为0(因为题目要求最小的满足条件的值),如果不一样(则需要考虑那一位上异或个1),则判断数列A在那一位上0的个数是否等于数列B那一位上1的个数,不等于则无解,否则,那一位上set为1,继续判断。 1 #... 阅读全文
posted @ 2015-08-01 20:09 hxy_has_been_used 阅读(191) 评论(0) 推荐(0)
摘要: 很容易想到是最大匹配:行和列看做点,每一个可放置的位置看做边,先求一遍最大匹配,然后枚举删除每一条边,如果删除了某一条边发现求出来的最大匹配比之前少,则这条边对应的格点是”重要点“。 1 #include 2 #include 3 #include 4 using namespace std;... 阅读全文
posted @ 2015-08-01 09:08 hxy_has_been_used 阅读(172) 评论(3) 推荐(0)