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 1320. Graph Decomposition

Test 6 is unfairly tricky (+)
Posted by Dmitry 'Diman_YES' Kovalioff 12 Sep 2004 16:37
If you get WA(6) just change

while NOT (EOF) do

to

while NOT (SeekEOF) do

and your program may get AC, as mine one (0.03 sec, 377 Kb on Pascal ;] )

I understand why it happens (the last line of input is empty), but really cannot understand why was such test included to the testset. IMHO, it is unfairly tricky...
Re: Test 6 is unfairly tricky (+)
Posted by Vladimir Yakovlev (USU) 12 Sep 2004 17:38
If you read numbers with function read(), then after last numbers read CR/LF symbols still remain in input stream, so eof() returns false, because it's really not the end of file.
In the test #6 I don't see any empty lines or something tricky.
But why after changing EOF to SeekEOF my program got AC? I can send you my code (-)
Posted by Dmitry 'Diman_YES' Kovalioff 12 Sep 2004 17:44
it is true.
Posted by Aleksey (BMSTU IU7) 26 Sep 2004 03:30
Thanks.
My program crash on test #6
I just have changed:
while NOT (EOF) do begin  read(a,b); ... to
while NOT (SeekEOF) do begin  read(a,b); ...
and i've got AC!