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 listAug 3, 2022 01:56Yuriy 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
1Aug 3, 2022 01:5500000Error: expected "2273363613 ", got "2147483648 "stderr
2Aug 3, 2022 01:5500000Error: expected "2294029489 ", got "2147483648 "stderr
3Aug 3, 2022 01:566,05476,301,53035,459,00014,183,0002,301,952
4Aug 3, 2022 01:566,06176,539,25239,561,00010,143,0002,498,560
5Aug 3, 2022 01:566,072113,595,34449,788,77802,314,240
6Aug 3, 2022 01:566,072119,454,56549,788,36402,314,240
7Aug 3, 2022 01:566,07377,469,15136,852,00012,948,0002,514,944
8Aug 3, 2022 01:566,074122,642,52449,810,44402,314,240
9Aug 3, 2022 01:566,08981,143,11536,949,00012,982,0002,453,504
10Aug 3, 2022 01:566,09073,412,58138,954,00010,987,0002,469,888
11Aug 3, 2022 01:566,12474,381,03535,152,00015,065,0002,453,504
12Aug 3, 2022 01:566,12773,320,73636,176,00014,068,0002,445,312
13Aug 3, 2022 01:566,23173,176,22940,077,00011,021,0002,301,952
14Aug 3, 2022 01:566,26784,365,32537,282,00014,106,0002,392,064