|
|
вернуться в форум#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=1526You are right, m = 0 in the 1st test. This limitation in the problem statement is fixed now. But there is a division by zero in his code! Sandro, why did you delete my post? 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. 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 Captain Obvious to the rescue! Noob, oh, i understand. Edited by author 14.08.2012 00:04 |
|
|