ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1098. Questions

Test #7
Послано Tbilisi SU: Eldar Bogdanov 11 окт 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
Послано Tbilisi SU: Eldar Bogdanov 16 окт 2006 03:21
No suggestions? :D
Re: Test #7
Послано Vladimir Yakovlev (USU) 16 окт 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
Послано Tbilisi SU: Eldar Bogdanov 16 окт 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
Послано chenyichen 2 авг 2008 15:18
The same trouble with you