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

Обсуждение задачи 1526. Martian Plates

First test doesn't fit the statement limitations! (+)
Послано Yermak 11 авг 2012 20:38
#include <stdio.h>
int p,t,n,m;
int main()
{
    scanf("%d%d%d%d",&p,&t,&n,&m);
    if (p<2 || p>10000 || t<2 || t>200 || (t&1) || n<1 || n>10 || m<1 || m>100)
        return 1/(p-p);
    return 0;
}

This program gets "Crash (integer division by zero)" at test #1.
http://acm.timus.ru/status.aspx?space=1&num=1526
Re: First test doesn't fit the statement limitations! (+)
Послано Sandro (USU) 12 авг 2012 13:08
You are right, m = 0 in the 1st test. This limitation in the problem statement is fixed now.
Re: First test doesn't fit the statement limitations! (+)
Послано Andrew Sboev [USU] 12 авг 2012 16:06
But there is a division by zero in his code! Sandro, why did you delete my post?
Re: First test doesn't fit the statement limitations! (+)
Послано Sandro (USU) 13 авг 2012 01:34
Because the solution of Yermak is a input validator. If the system verdict on some test is Crash (division by zero), then this test is incorrect. If the test is correct, system verdict should be Wrong Answer.
Re: First test doesn't fit the statement limitations! (+)
Послано Andrew Sboev [USU] 13 авг 2012 11:54
Sandro, look at this line of his code! There is a division by zero if condition is true, because p-p = 0!

if (p<2 || p>10000 || t<2 || t>200 || (t&1) || n<1 || n>10 || m<1 || m>100)
        return 1/(p-p);


Edited by author 13.08.2012 11:55
Re: First test doesn't fit the statement limitations! (+)
Послано Noob 13 авг 2012 22:43
Captain Obvious to the rescue!
Re: First test doesn't fit the statement limitations! (+)
Послано Andrew Sboev [USU] 14 авг 2012 00:03
Noob, oh, i understand.

Edited by author 14.08.2012 00:04