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

Обсуждение задачи 1094. Дисплей

Problem 1094 "E-screen" has been rejudged (+)
Послано Vladimir Yakovlev (USU) 7 янв 2007 07:33
Old tests were fixed: end-of-line characters were added in the end of input.
New tests were added. Validator program was updated.
Timelimit was decreased to 0.25 sec.

After rejudge 26 authors got AC, but 512 lost AC.

Edited by author 07.01.2007 07:34
Re: Problem 1094 "E-screen" has been rejudged (+)
Послано MegaSerg 8 янв 2007 01:45
I changed one symbol im my program and got AC once more.
Maybe is there a bug again?
Maybe your new program is correct? (-)
Послано Vladimir Yakovlev (USU) 8 янв 2007 06:13
Check the tests again, please
Послано Ostap Korkuna (Lviv NU) 8 янв 2007 20:42
In the problem statement it is said:
"The single line of the input contains..."
The SINGLE LINE means no '\n' characters!

but this program gets Crash(1):

#include <stdio.h>
int main()
{
    char c;
    while (scanf("%c", &c) == 1)
    {
        if (c == '\n')
            throw(0);
    }
    return 0;
}

And this one gets TL(1)

#include <stdio.h>
int main()
{
    char c;
    while (scanf("%c", &c) == 1)
    {
        if (c == '\n')
            while(1);
    }
    return 0;
}


Isn't it strange ???

Edited by author 08.01.2007 20:43
The single line supposes '\n' character in the end (-)
Послано Vladimir Yakovlev (USU) 9 янв 2007 02:03


Edited by author 09.01.2007 13:53
Re: The single line supposes '\n' character in the end (-)
Послано Ostap Korkuna (Lviv NU) 10 янв 2007 02:37
Interesting :-)
I always thought that '\n'-character is the splitter for lines . That means if the number of '\n'-characters is K, so the number of lines is K+1...
I think, that you should write in problem statement - "there is endline character after input" or "input is ended by endline char"

I don't insist to change problem statement or tests, I just want to tell my opinion.

I am sure, if you open the file with one of your test in text editor you will see 2 lines (the second one is empty).
It is not very "interesting" to get WA because of that :-)
Re: The single line supposes '\n' character in the end (-)
Послано Life is short... 11 янв 2007 15:37
If you open a file in a hexedit then you'll see that 0A0D symbols are the end of line, followed by EOF. So there is exactly 1 line, but notepad lets you to move your cursor on another line just because there was end of line though there isn't second line endeed.