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:05Joad 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:0400000Error: expected "2280401337 ", got "2064166970 "stderr
2Dec 25, 2024 03:0400000Error: expected "2240701035 ", got "2232647991 "stderr
3Dec 25, 2024 03:0400000Error: expected "2344327575 ", got "2138569589 "stderr
4Dec 25, 2024 03:0400000Error: expected "2260151429 ", got "2185541940 "stderr
5Dec 25, 2024 03:0500000Error: No answer to stdout. Died or killed?stderr
6Dec 25, 2024 03:053,77853,439,90829,981,000999,0002,510,848
7Dec 25, 2024 03:053,88257,502,10627,855,0003,979,0002,510,848
8Dec 25, 2024 03:053,88852,622,79127,897,0003,985,0002,510,848