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 1078. Segments

WA test #4 or #6. Here's the bug!!
Posted by Dang Quang Huy 1 Jul 2016 20:08
test #4, if you sort the left nodes then before updating the DP[i], you should check whether their left nodes are coincide or not.
e.g:
4
1 2
1 3
1 4
1 5
test #6: this test has n == 1, you just need to print 1 and 1 in the output.