|
|
back to boardHelp! WA test #5 I use unsigned long. res=double(a[count/2-1])/2.0+double(a[count/2])/2.0 test: 2 4000000001 4000000000 answer: 4000000000.5 I can't anderstand why WA test 5# Please, Help. Your test is incorrect 4000000000 > 2147483647 and 4000000001 > 2147483647 too. It is bad test. I wrote double res = (double)arr[count/2] + (double)arr[count/2-1]; res /= 2; And this worked. Re: Your test is incorrect -> His test is actually correct! 4000000000 and 4000000001 is not a bad test! Read the problem carefully. The max number in sequence can be (2^32 - 1) = 4294967295. So (4 * 10^9) is pretty OK for a test. |
|
|