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

Обсуждение задачи 1437. ACM для ГСМ

ADMINS! YOUR SERVER IS ONE BIG BUG!
Послано whywaidontknow 30 авг 2006 12:11
problem#1437 WA #1
it's impossible;
2 cases: "crash(int div by zero)" or "output limit"
but you server give WA

WHY!?

include <stdio.h>
int main()
{
    int N;
    scanf("%i",&N);
int b;
scanf("%i",&b);
scanf("%i",&b);
    if (N==0) N=b/0; else while (true) printf("123442343234234343423243242344");
    return 0;
}
Re: ADMINS! YOUR SERVER IS ONE BIG BUG!
Послано Samsonov Alex [USU] 30 авг 2006 12:34
Do you know what "Output Limit Exceeded" means? Think about it before being rude.
Re: ADMINS! YOUR SERVER IS ONE BIG BUG!
Послано whywaidontknow 30 авг 2006 12:49
while (true) printf("123123123123");
gets output limit

I know why this program don't work.
it's optimization, I must add in last line
"printf("%i",N);"

in VS 6.0 program gets crash anyway

but I realy don't understand, why it gets WA#1
this program on test #1 (0 3 4) don't output anything

Edited by author 30.08.2006 12:55
Re: ADMINS! YOUR SERVER IS ONE BIG BUG!
Послано KAV 1 сен 2006 11:41
Sometimes 1/0 isn't crash :(
I tried to find mistakes in one my program so, but didn't receive crash - as you.
Compiler tries to optimize your code (+)
Послано Vladimir Yakovlev (USU) 5 сен 2006 00:16
Compiler tries to optimize your code and do not run last command (N=b/0) because value of N is not used after this assignment.