ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1018. Binary Apple Tree

Ilya Mitin If you got WA [22] // Problem 1018. Binary Apple Tree 12 May 2008 19:49
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
Ai.Freedom Re: If you got WA [1] // Problem 1018. Binary Apple Tree 25 Jun 2008 00:42
thanks a lot for your test cases!
Aoki Re: If you got WA // Problem 1018. Binary Apple Tree 23 Feb 2018 06:15
thanks!
sanok Re: If you got WA // Problem 1018. Binary Apple Tree 15 Dec 2008 02:15
Thank you for test data. I suppose there is typo in case #1. Correct answer must be 51.
Hakkinen Re: If you got WA [1] // Problem 1018. Binary Apple Tree 26 Jan 2009 18:41
kiitos!
I got AC
tcet Re: If you got WA // Problem 1018. Binary Apple Tree 12 Mar 2012 22:19
哈哈
evjava Re: If you got WA [2] // Problem 1018. Binary Apple Tree 24 Oct 2009 19:59
Why in the first example ans=21? I think it  must be 51.
Oleg Strekalovsky [Vologda SPU] Re: If you got WA [1] // Problem 1018. Binary Apple Tree 31 Dec 2010 20:25
evjava wrote 24 October 2009 19:59
Why in the first example ans=21? I think it  must be 51.
First test is incorrect. Q must be <=N-1.
Anton Re: If you got WA // Problem 1018. Binary Apple Tree 9 Apr 2011 18:27
Big thanks!
Mato_No1 Re: If you got WA // Problem 1018. Binary Apple Tree 25 Jul 2010 15:38
I could AC all your tests, but I still got WA.
bojan Re: If you got WA [1] // Problem 1018. Binary Apple Tree 14 Oct 2011 06:15
THX
BaJIuK Re: If you got WA // Problem 1018. Binary Apple Tree 3 Nov 2011 02:25
My falt was that my inf was too litlle ^^ thx a lot!
EZ_YE88ZI Re: If you got WA // Problem 1018. Binary Apple Tree 3 Dec 2011 06:43
哈哈
EZ_YE88ZI Re: If you got WA // Problem 1018. Binary Apple Tree 3 Dec 2011 06:43
吃高高
EZ_YE88ZI Re: If you got WA // Problem 1018. Binary Apple Tree 3 Dec 2011 06:44
吃JB
ez_wyc Re: If you got WA // Problem 1018. Binary Apple Tree 3 Dec 2011 06:44
吃粪汁啦 第一组和第三组数据吃粪一样的。。。第一组很明显不可能啦 第三组这叫一个苹果“二叉”树
EZ_YE88ZI Re: If you got WA // Problem 1018. Binary Apple Tree 3 Dec 2011 06:44
什么是粪汁?
EZ_YE88ZI Re: If you got WA // Problem 1018. Binary Apple Tree 3 Dec 2011 06:45
粪汁是不是一种汁
EZ_YE88ZI Re: If you got WA // Problem 1018. Binary Apple Tree 3 Dec 2011 06:45

Edited by author 03.12.2011 06:51

Edited by author 03.12.2011 06:51
AndreyPikas [Yaroslavl SU] Re: If you got WA // Problem 1018. Binary Apple Tree 4 Dec 2011 16:23
3-rd test case is incorrect, because "any biparous branch splits up to exactly two new branches"
vlyubin Re: If you got WA // Problem 1018. Binary Apple Tree 29 Mar 2012 09:45
Remember that the tree should always be a tree (you can't split it into several components)...
iOli Re: If you got WA // Problem 1018. Binary Apple Tree 23 Oct 2017 16:50
Thank you very much.
capitan.ARA.code Re: If you got WA // Problem 1018. Binary Apple Tree 7 Aug 2020 13:08
are you sure i think 5 5 mean we must have all vertex ans ans is 51
5 5
3 1 1
4 1 10
2 3 20
3 5 20
ans = 51