|  | 
|  | 
| back to board | First test doesn't fit the statement limitations! (+) Posted by Yermak  11 Aug 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=1526Re: First test doesn't fit the statement limitations! (+) 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! (+) 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! (+) 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! (+) 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! (+) Posted by Noob  13 Aug 2012 22:43Captain Obvious to the rescue!Re: First test doesn't fit the statement limitations! (+) Noob, oh, i understand.
 Edited by author 14.08.2012 00:04
 | 
 | 
|