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 1871. Seismic Waves

Probable weak tests
Posted by Marginean Ciprian 15 Oct 2012 00:14
Consider the following test:

7
Wayne 2 Bruce Dick
Bruce 1 Brown
Dick 1 Grayson
Brown 1 Gordon
Grayson 1 Gordon
Gordon 1 Stephanie
Stephanie 1 Wayne
Master Wayne is going to disguise as Batman and stop the Joker! I must prepare the Batmobile for his quest!

My solution fails to print Stephanie as a person who received the tweet about the earthquake. My solution uses a shortest path algorithm and that is why it takes into consideration only the shortest tweet reaching Gordon(the tweet sent by Grayson). So Gordon will try to send the tweet that he received(on the path Wayne Dick Grayson) preappended with "RT @Grayson: "(which is 13 characters long), totalling 141 characters. So the algorithm concludes that Stephanie will receive no tweet. But if we take the path Wayne, Bruce, Brown to Gordon, Gordon will receive a longer tweet than on the other path, but Stephanie will receive a tweet totalling 140 characters so she will actually be notified by a tweet too, although my algo fails to notice this.

I believe that there are great chances that other shortest path algos implemented by other users behave the same, so please try to consider improving the tests with a test similar with mine,

Regards,
Ciprian

Edited by author 15.10.2012 00:16
Re: Probable weak tests
Posted by Sandro (USU) 15 Oct 2012 13:34
Your test was added. Thank you.