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

Anyone have any ideas on what Test 8 is doing?
Posted by SquidBoy 8 Mar 2013 11:27
Had some issues implementing the heap, and then realised had a nice Access Violation (didn't bother to check we weren't exceeding the bounds on the heaps underlying array).

Now I'm stuck on Test #8 - but I've tried every test I've seen suggested in the comments....Anyone got a nice test to try ???
Re: Anyone have any ideas on what Test 8 is doing?
Posted by SquidBoy 12 Mar 2013 05:12
I've even tried generating up to about 190000 random numbers < 2^31-1 in Excel (3 columns) and my median always agrees with theirs....

I've Also tried the same number of ordered numbers (incrementing by 1) as well as random but sorted numbers in a single column (sorted in both directions).

I suspect I have some silly output issue (rather than a logic issue - but that might just be because I;m arrogant).
I think the admins might want to check the wording
Posted by SquidBoy 12 Mar 2013 05:41
Ok, for those who have trouble with test 8.  Apparently 0 is a valid value in the tests (I'd assumed that POSITIVE meant "strictly greater than 0" - I would have thought including 0 is NON-NEGATIVE rather than POSITIVE).  Once I catered for the possibility of 0 in the heap, everything was happy....
In my case
Posted by josue.0 2 Jul 2016 12:59
In my case I was getting wrong one of the elements for the semi-sum.