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

Please help, what is test #5
Posted by L.E.O. 16 Oct 2011 14:08
I using dfs, but always get WA5. Where was I mistake?

Edited by author 18.10.2011 22:18
Re: Please help, what is test #5
Posted by L.E.O. 18 Oct 2011 14:10
Help, please
Re: Please help, what is test #5
Posted by Kuchumov_Ilya 18 Oct 2011 19:43
scanf("\n") ignore first ' ' symbols in next string.

Edited by author 18.10.2011 19:43
Re: Please help, what is test #5
Posted by L.E.O. 18 Oct 2011 22:20
Thank you, I got AC :)
PS: fool mistake :(
Re: Please help, what is test #5
Posted by IgorKoval(from Pskov) 22 Oct 2011 23:37
Tell this ""fool mistake"", please.
Re: Please help, what is test #5
Posted by L.E.O. 25 Oct 2011 09:37
I'm get WA5, because I'm wrong read data.
Example:
2
A 1 B
B 1 A
  message

My init length message was 7, but actual init length was 9 (7 + 2 first space).
"fool mistake": scanf("\n") - ignoring first '\n', '\t' and ' ', but to me need is ignoring first '\n'.