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 1473. Farm 2

IGOR_Lviv NU To admins [4] // Problem 1473. Farm 2 29 Nov 2007 08:56
Why does this code get crash on test 27?
...
int N;
scanf("%d", &N);
int x;
int y;
int z;
for(int i = 0, i < N; ++i)
{
scanf("%d%d%d", &x, &y, &z);
if(z != 2 && z != 1)
throw 25;
...
IGOR_Lviv NU Re: To admins [2] // Problem 1473. Farm 2 30 Nov 2007 13:03
Is it so hard to answer me?!!!
[SPbSU ITMO] WiNGeR Re: To admins [1] // Problem 1473. Farm 2 1 Dec 2007 07:01
Maybe Crash is somewhere else?
Sandro (USU) Re: To admins // Problem 1473. Farm 2 1 Dec 2007 12:29
#include <cstdio>
int main()
{
    int N,i;
    scanf("%d", &N);
    if (N<1 || N>10000)
        throw 25;
    int x;
    int y;
    int z;
    for(i = 0; i < N; ++i)
    {
        scanf("%d%d%d", &x, &y, &z);
        if (z != 2 && z != 1)
            throw 25;
        if (x<0 || x>10000 || y<0 || y>10000)
            throw 25;
    }
    return 0;
}

This code doesn't got Crash on any test. Look for a bug in your program.

Edited by author 01.12.2007 12:30
Tural Neymanov In russian variant... // Problem 1473. Farm 2 5 Aug 2008 19:04
В следующих K строках выведите через пробел числа ai и bi — величины, которыми могут руководствоваться "экперты" при принятии решения.