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 1888. Pilot Work Experience

test 24
Posted by Magnitogorsk STU 30 Oct 2011 14:03
Can you public this test or tell about idea in it? Yesterday we can't got "Accepted", because always got "WA 24" (Magnitogorsk STU). We have no idea about our mistake.
Maybe test is incorrect?
Re: test 24
Posted by Nadeem Moidu 30 Oct 2011 19:59
Are you correctly handling the case when the graph is disconnected?
Re: test 24
Test is correct, you have already asked it during the contest and have already had an answer. Idea of you mistake is that you cannot assume that the most distant vertex from some randomly chosen is an end of diameter. It is true for a tree, but not for an arbitrary graph.
If you are still unsure, I can send you this test via email, if you tell me your address.
Re: test 24
Posted by svr 30 Oct 2011 21:27
I also had many WAs. I used only 1 bfs. But when I applied n bfs for each vertex as a root and took best with respect of height of bfs-tree I got Ac.