If you got WA
0) AC solve is DP on tree.
1) In DP inf = 1e9.
2) All test in the forum:
5 5
3 1 1
4 1 10
2 3 20
3 5 20
ans = 21
7 4
1 2 10
1 3 20
2 4 30
2 5 0
3 6 0
3 7 40
ans = 100
4 1
1 2 1
1 3 2
2 4 3
ans = 2
5 1
1 2 1
1 5 0
2 3 0
2 4 0
ans = 1
7 3
1 2 1
1 3 39
2 4 40
2 5 40
3 6 39
3 7 39
ans = 117
5 2
1 3 1
1 4 10
2 3 20
3 5 20
ans = 21
Edited by author 12.05.2008 19:54
Re: If you got WA
thanks a lot for your test cases!
Re: If you got WA
Posted by
sanok 15 Dec 2008 02:15
Thank you for test data. I suppose there is typo in case #1. Correct answer must be 51.
Re: If you got WA
kiitos!
I got AC
Re: If you got WA
Posted by
evjava 24 Oct 2009 19:59
Why in the first example ans=21? I think it must be 51.
Re: If you got WA
I could AC all your tests, but I still got WA.
Re: If you got WA
Why in the first example ans=21? I think it must be 51.
First test is incorrect. Q must be <=N-1.
Re: If you got WA
Posted by
Anton 9 Apr 2011 18:27
Big thanks!
Re: If you got WA
Posted by
bojan 14 Oct 2011 06:15
THX
Re: If you got WA
Posted by
BaJIuK 3 Nov 2011 02:25
My falt was that my inf was too litlle ^^ thx a lot!
Re: If you got WA
Posted by
ez_wyc 3 Dec 2011 06:44
吃粪汁啦 第一组和第三组数据吃粪一样的。。。第一组很明显不可能啦 第三组这叫一个苹果“二叉”树
Re: If you got WA
粪汁是不是一种汁
Re: If you got WA
Edited by author 03.12.2011 06:51
Edited by author 03.12.2011 06:51
Re: If you got WA
3-rd test case is incorrect, because "any biparous branch splits up to exactly two new branches"
Re: If you got WA
Posted by
tcet 12 Mar 2012 22:19
哈哈
Re: If you got WA
Posted by
vlyubin 29 Mar 2012 09:45
Remember that the tree should always be a tree (you can't split it into several components)...