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 1344. Gigantic Turnip

Report of the wrong test data 8 (+)
Posted by Safe Bird 26 Feb 2005 18:59
I did so in the program:

void GoWrong()
{
 int a = 0;
 fprintf(Fou,"%d",1/a);
}

for (i=1; i<=n; i++)
 fscanf(Fin,"%*d %d %d %d", p[i], p[i]+1, p[i]+2);
for (i=1; i<=n; i++) for (j=0; j<3; j++) if (p[i][j]>0)
 if ( p[p[i][j]][0]!=i && p[p[i][j]][1]!=i && p[p[i][j]][2]!=i ) GoWrong();

and i really got RE(divided by 0). I think such testcase is illeagle. BTW if I use "if n=9 then writeln('2.0000')" I'll get AC.
Fixed (+)
Posted by Vladimir Yakovlev (USU) 27 Feb 2005 18:11
There was an error in input of test 8.
I fixed it. Your first submit is AC now.
:)thanx (-)
Posted by Safe Bird 27 Feb 2005 20:11


Edited by author 03.03.2006 17:38
Are tests OK now?
Posted by Michael Rybak (accepted@ukr.net) 2 Mar 2006 21:06
I have exactly the same problem on test 20. I figured out (with binary search on what assertions failed) that some rope isn't matched, and after that I read your message, and, just for the sake of being precise, rewrote my code in the following way, copypasting from yours:

#define ASSERT(x) if (!(x)) while (1) cout << 1;else 1

...

int t[1000][4];
int n;

int main()
{
  int i, j;
  cin >> n;
  for (i=1; i<=n; i++)
    scanf("%*d %d %d %d", t[i], t[i]+1, t[i]+2);
  for (i=1; i<=n; i++) for (j=0; j<3; j++) if (t[i][j]>0)
    if ( t[t[i][j]][0]!=i && t[t[i][j]][1]!=i && t[t[i][j]][2]!=i )
      ASSERT(false);

...
}

This code gets Output Limit Exceeded on test 20. Replacing ASSERT(false) with ASSERT(true) in that line makes it get Crash at test 20, which means this exact assertion has failed.

Admins, please clarify.

[EDITED BY RYBAK]
The story looks very similar. Instead of ASSERT(false) I wrote:

    {
      cout << "1.0000";
      return 0;
    }

and got AC. Still I wonder how everyone else treat such situation?


Safe Bird wrote 27 February 2005 20:11

Edited by author 02.03.2006 21:15
Yes, test 20 is wrong!
Posted by Walrus 21 Jul 2006 00:55
Judges, pls correct test 20!
Posted by TO THE TOP 17 Mar 2008 16:30
People must have a chance to AC this problem not reading forum before ))
Re: Judges, pls correct test 20!
Posted by Vedernikoff Sergey 17 Mar 2008 22:00
I think, tests were corrected - I've ACed the problem without reading forum =)
Re: Judges, pls correct test 20!
Posted by TO THE TOP 18 Mar 2008 17:07
It doesn't mean anything. In 20 test there is a block A, which connected to block B, but block B doesn't connect to block A.