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 1508. Japanese Puzzle

To Admin: There must be something wrong in the testcase!
Posted by Amber [Is it snowy?] 1 Nov 2006 12:17
In the description of input, "The second line contains K integers". If K = 0, the second should be empty line.
But in Sample input #2
9 0
??????.X?

There is not so-called second line.
So I read data like following. and got WA at 3.
----------------
Readln(N, M);
if M > 0 then
begin
    for i := 1 to M do
        Read(L[i]);
    Readln;
end;
for i := 1 to N do
    Read(T[i]);
----------------

Then I suppose sample input #2 is wrong, there must be an empty line in second line when K = 0.
I change code like following. and got WA at 20.
----------------
Readln(N, M);
for i := 1 to M do
    Read(L[i]);
Readln;
for i := 1 to N do
    Read(T[i]);
----------------

It implys there is some invalid char in input file.
So I change code like following. and got AC.

Readln(N, M);
for i := 1 to M do
    Read(L[i]);
for i := 1 to N do
    repeat
        Read(T[i]);
    until T[i] in ['X', '.', '?'];

So there must be something wrong in testcase.
Re: To Admin: There must be something wrong in the testcase!
Posted by Vladimir Yakovlev (USU) 1 Nov 2006 13:26
There was a bug in sample output #2. Tests are correct.