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 03:01Joad 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 03:0000000Error: expected "2229527870 ", got "2153069276 "stderr
2Dec 25, 2024 03:0000000Error: No answer to stdout. Died or killed?stderr
3Dec 25, 2024 03:0000000Error: No answer to stdout. Died or killed?stderr
4Dec 25, 2024 02:5400000Error: expected "2280651091 ", got "2139763374 "stderr
5Dec 25, 2024 02:5400000Error: No answer to stdout. Died or killed?stderr
6Dec 25, 2024 02:5400000Error: No answer to stdout. Died or killed?stderr
7Dec 25, 2024 02:5400000Error: expected "2264016415 ", got "2226605386 "stderr
8Dec 25, 2024 02:5300000Error: expected "2259758910 ", got "2170780477 "stderr
9Dec 25, 2024 02:543,71155,539,60826,374,0004,057,0002,400,256
10Dec 25, 2024 02:543,72858,546,20629,549,0001,018,0002,510,848
11Dec 25, 2024 02:543,73463,332,13728,580,0002,041,0002,510,848
12Dec 25, 2024 02:543,73558,698,31828,587,0002,041,0002,392,064
13Dec 25, 2024 02:543,76157,858,19728,853,0001,989,0002,396,160
14Dec 25, 2024 02:543,76256,310,34130,850,00002,510,848
15Dec 25, 2024 02:543,79154,000,39928,077,0003,008,0002,400,256
16Dec 25, 2024 02:543,79653,467,84427,112,0004,016,0002,486,272
17Dec 25, 2024 02:543,88756,364,32329,879,0001,991,0002,392,064
18Dec 25, 2024 03:013,90057,256,62129,980,0001,998,0002,396,160
19Dec 25, 2024 03:013,93958,853,87231,288,0001,009,0002,510,848
20Dec 25, 2024 03:013,98256,965,02131,635,0001,020,0002,510,848