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 listMay 15, 2023 13:50Martin StensgårdMartin StensgårdError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 15, 2023 13:4000000Error: expected "2281734791 ", got "2281701376 "stderr
2May 15, 2023 13:4200000Error: expected "2300023241 ", got "2299985920 "stderr
3May 15, 2023 13:3851,854509,676,199425,202,23102,322,432
4May 15, 2023 13:4552,485491,158,929430,375,44102,322,432
5May 15, 2023 13:3852,703506,111,567432,160,70402,199,552
6May 15, 2023 13:4552,757503,901,487432,608,28402,203,648
7May 15, 2023 13:3852,780487,017,513432,796,01502,326,528
8May 15, 2023 13:5052,804489,763,654432,994,28102,310,144
9May 15, 2023 13:5052,836491,495,956433,254,37302,248,704
10May 15, 2023 13:4552,897487,644,822433,752,61202,207,744
11May 15, 2023 13:5053,086502,415,029435,307,82502,199,552