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 1306. Sequence Median

Help! WA test #5
Posted by Compile 4 Mar 2005 22:38
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
Posted by I am get tester... 23 Oct 2005 13:29
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!
Posted by Peter Petrov (Sedefcho) 14 Jul 2006 18:00
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.