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 14:02Martin 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 14:0000000Error: expected "1964546244 ", got "1964507136 "stderr
2May 15, 2023 14:0100000Error: expected "2304014138 ", got "2303983616 "stderr
3May 15, 2023 14:0251,340475,655,910420,984,35002,199,552
4May 15, 2023 14:3051,687490,599,027423,831,49202,207,744
5May 15, 2023 14:3051,816479,195,941424,890,90002,277,376
6May 15, 2023 14:0251,852475,520,306425,185,28602,232,320
7May 15, 2023 14:0251,949479,242,931425,977,81602,220,032
8May 15, 2023 14:3053,020493,053,014434,760,81802,293,760