Median Sergey Svistunov

Find the median of a stream of binary integers as fast as possible.

Input: 100 000 000 uint32 values in little-endian binary on STDIN (4 bytes each).

Output: The median value, printed as a decimal string. The median is defined as the element at index N/2 (i.e., a[50000000]) in the sorted array.

Back to listDec 25, 2024 02:32Joad NacerJoad NacerError
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 25, 2024 02:3100000Error: expected "2266599935 ", got "2122580618 "stderr
2Dec 25, 2024 02:3600000Error: expected "2250889542 ", got "2085079594 "stderr
3Dec 25, 2024 02:3500000Error: expected "2253323468 ", got "2199578671 "stderr
4Dec 25, 2024 02:3200000Error: No answer to stdout. Died or killed?stderr
5Dec 25, 2024 02:3200000Error: No answer to stdout. Died or killed?stderr
6Dec 25, 2024 02:3200000Error: No answer to stdout. Died or killed?stderr
7Dec 25, 2024 02:3100000Error: No answer to stdout. Died or killed?stderr
8Dec 25, 2024 02:3100000Error: expected "2274951216 ", got "2219925990 "stderr
9Dec 25, 2024 02:3100000Error: No answer to stdout. Died or killed?stderr
10Dec 25, 2024 02:323,94460,694,30731,332,0001,010,0002,506,752
11Dec 25, 2024 02:323,94551,800,16431,340,0001,010,0002,510,848
12Dec 25, 2024 02:323,95154,368,86130,371,0002,024,0002,506,752
13Dec 25, 2024 02:324,00563,168,79731,848,000995,0002,396,160
14Dec 25, 2024 02:324,03154,253,03931,055,0002,003,0002,510,848
15Dec 25, 2024 02:324,06766,064,96332,342,0001,010,0002,510,848
16Dec 25, 2024 02:324,07455,915,60032,398,0001,012,0002,510,848
17Dec 25, 2024 02:324,09454,918,34729,504,0004,069,0002,510,848
18Dec 25, 2024 02:324,25057,496,27131,863,0002,987,0002,506,752