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

got AC time=0.25
Posted by buggzy 2 Apr 2004 14:56
...and without re-reading input. O(N*logN) sometimes faster then O(N) ;-) Nice problem.

Edited by author 02.04.2004 15:27
Re: got AC time=0.25
Posted by Илья Гофман (Ilya Gofman) 2 Apr 2004 21:59
could you please open up your secret? at leaest a bit? many people are worried about it:)))
Re: got AC time=0.25
Posted by buggzy (USU) 2 Apr 2004 22:30
I guess you confused me with the very best man who solved this  problem in N/2 memory. Sorry, I'm just Ilya Teterin from contest.ur.ru forum :), so I'm interested in the "secret" too ;)
Re: got AC time=0.25
Posted by BloodMage 3 Apr 2004 11:41
Use a data structure of Heap
Heap can help you insert in O(logn) and "pop" the biggest/smallest item in O(logn), and to realise it you need only a array.
With "Heap" we can solve this problem so easily. Read half of the data from the input, and then read one, pop biggest/smallest one, you can find at last pop one/two time(s), the midest number is found!!
Re: got AC time=0.25
Posted by jedimastex 3 Apr 2004 14:34
hay, can you send solution to email mathit@mail.ru
;->

Edited by author 02.01.2006 17:04
Re: got AC time=0.25
Posted by buggzy (Ilya Teterin - USU) 3 Apr 2004 16:52
I made "gcc median2.cpp -o median2.cpp" yesterday ;) If you familiar with GNU C compiler you will understand...
Re: got AC time=0.25
Posted by I_want_to_be_The_Best 31 May 2005 11:11
i got AC time=0.14 !!