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

To admins
Posted by IGOR_Lviv NU 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;
...
Re: To admins
Posted by IGOR_Lviv NU 30 Nov 2007 13:03
Is it so hard to answer me?!!!
Re: To admins
Posted by [SPbSU ITMO] WiNGeR 1 Dec 2007 07:01
Maybe Crash is somewhere else?
Re: To admins
Posted by Sandro (USU) 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
In russian variant...
Posted by Tural Neymanov 5 Aug 2008 19:04
В следующих K строках выведите через пробел числа ai и bi — величины, которыми могут руководствоваться "экперты" при принятии решения.