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

What is for test 28?
Posted by Vitaliy Karelin 15 Oct 2011 17:18
Re: What is for test 28?
Posted by svr 15 Oct 2011 18:32
I had wa28 when in dfs-search visited each string ony once,
but we must visit strings more than once if  coming to this person post became shorter.
Re: What is for test 28?
Posted by morbidel 17 Oct 2011 14:18
So Dijkstra looks like is needed.
Re: What is for test 28?
Posted by svr 17 Oct 2011 14:26
I used many dfs call from v=1 until stabilization("seismic waves from v=1")
Re: What is for test 28?
Posted by rohit 17 Oct 2011 22:39
I use bfs but I also get WA 28.
Re: What is for test 28?
Posted by svr 17 Oct 2011 22:47
You are using standard bfs, when once formed vertex skipped after,
but in this problem we must do processing of each event of vertex echivement
on subject of string length.
Re: What is for test 28?
Posted by falicos 17 Jun 2013 11:41
This test help me to solv WA28
10
0000000000000000000000000 2 444444444444444444444444 777777
11111111111111111111111 3 55 777777 8888
22222222 3 11111111111111111111111 444444444444444444444444 8888
3333 1 444444444444444444444444
444444444444444444444444 3 2 55 8888
55 3 3333 444444444444444444444444 6
6 2 22222222 444444444444444444444444
777777 3 444444444444444444444444 6 55
8888 3 11111111111111111111111 22222222 777777
999999999999999999999999 2 444444444444444444444444 55
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

answer

9
0000000000000000000000000
22222222
3333
444444444444444444444444
55
6
777777
11111111111111111111111
8888
Re: What is for test 28?
Posted by Otrebus 8 Dec 2015 23:27
Please note that falicos's test is incorrect; the line "444444444444444444444444 3 2 55 8888" implies there is a user named "2", which is not specified by the input and hence illegal. If you remove the "3" from that line you get legally formatted input with the given answer correct.

If you interpret the above test to mean there is a user named "2" with no followers, the answer would be

10
0000000000000000000000000
11111111111111111111111
2
22222222
3333
444444444444444444444444
55
6
777777
8888