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

Compile Help! WA test #5 [2] // Problem 1306. Sequence Median 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.
I am get tester... Your test is incorrect [1] // Problem 1306. Sequence Median 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.
Peter Petrov (Sedefcho) Re: Your test is incorrect -> His test is actually correct! // Problem 1306. Sequence Median 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.