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 1098. Questions

Test #7
Posted by Tbilisi SU: Eldar Bogdanov 11 Oct 2006 02:39
I've tried to solve this problem using lists and with the Josephus algorithm and both approaches had WA7, it seems I can't read the input properly. I've tried different approaches here, too:

1.
while not eof do
begin
read(s[i]);
if (ord(s[i])=13) or (ord(s[i])=10) then dec(i);
inc(i);
end;

2.
repeat
  readln(ss);
  for i:=len+1 to len+length(ss) do s[i]:=ss[i-len];
  len:=len+length(ss);
until eof;

And many others, but I always get WA7. What's that test?!
Re: Test #7
Posted by Tbilisi SU: Eldar Bogdanov 16 Oct 2006 03:21
No suggestions? :D
Re: Test #7
Posted by Vladimir Yakovlev (USU) 16 Oct 2006 15:07
This input is OK:

txt := '';
while not eof do
begin
    read(c);
    if c in [#10,#13] then
        continue;
    txt := txt + c;
end;
Re: Test #7
Posted by Tbilisi SU: Eldar Bogdanov 16 Oct 2006 16:23
Thank you :)
I've got accepted, but it turned out that my problem wasn't in reading the input and I realized it only after getting WA7 with your inputting fragment, too. I outputed 'No comment' instead of 'No comments'... :D

Edited by author 16.10.2006 16:24

Edited by author 16.10.2006 16:24
Re: Test #7
Posted by chenyichen 2 Aug 2008 15:18
The same trouble with you