题目:http://www.lydsy.com/JudgeOnline/problem.php?id=2423题解:方案数比较麻烦。写在注释里吧, 1 #include 2 3 #include 4 5 #include 6 7 #include 8 9 #include ... Read More
posted @ 2015-01-27 16:08 ZYF-ZYF Views(253) Comments(0) Diggs(0) Edit
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=3653题解:稍微思考可以知道只要求x子树内dep[y]-dep[x] 2 3 #include 4 5 #include 6 7 #include 8 9 #include... Read More
posted @ 2015-01-27 11:09 ZYF-ZYF Views(556) Comments(0) Diggs(0) Edit
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1048题解:搞清题意之后来个记忆化爆搜就行了。代码: 1 #include 2 3 #include 4 5 #include 6 7 #include 8 9 #include10 11... Read More
posted @ 2015-01-27 10:18 ZYF-ZYF Views(215) Comments(0) Diggs(0) Edit