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 7, 2023 02:55Yuriy LyfenkoYuriy LyfenkoError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 7, 2023 02:5300000Error: expected "2004091074 ", got "1417996890 "stderr
2May 7, 2023 02:554,99267,059,78534,946,0005,990,0002,408,448
3May 7, 2023 02:555,04265,370,94535,292,0006,050,0002,293,760
4May 7, 2023 02:555,09670,175,50131,840,0009,950,0002,498,560
5May 7, 2023 02:555,09963,419,18631,857,0009,955,0002,293,760
6May 7, 2023 02:555,10171,723,49230,873,00010,955,0002,355,200
7May 7, 2023 02:555,10770,432,92632,903,0008,973,0002,441,216
8May 7, 2023 02:555,19169,626,60233,446,0009,121,0002,457,600
9May 7, 2023 02:555,19571,668,24538,539,0004,056,0002,420,736
10May 7, 2023 02:555,277107,109,84843,268,04502,326,528
11May 7, 2023 02:555,35271,064,62937,905,0005,985,0002,519,040
12May 7, 2023 02:555,485106,102,70044,976,27402,301,952
13May 7, 2023 02:555,572134,226,59745,693,46602,289,664