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 listJun 13, 2021 05:32Yuriy 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
1Jun 13, 2021 05:3100000Error: died or killed
2Jun 13, 2021 05:3000000Error: expected "2319485107 ", got "0 "
3Jun 13, 2021 05:3000000Error: expected "2280296423 ", got "0 "
4Jun 13, 2021 05:3000000Error: expected "1920065793 ", got "2341610183 "
5Jun 13, 2021 05:327,255129,636,93459,493,31802,215,936
6Jun 13, 2021 05:327,320121,821,65760,023,91702,236,416
7Jun 13, 2021 05:297,369124,610,07260,425,39402,236,416
8Jun 13, 2021 05:327,41090,569,31043,831,00016,934,0002,502,656
9Jun 13, 2021 05:297,423120,774,34760,870,22402,236,416
10Jun 13, 2021 05:327,461126,759,48861,177,23802,236,416
11Jun 13, 2021 05:327,46585,929,53147,163,00014,048,0002,498,560
12Jun 13, 2021 05:327,53289,958,05842,835,00018,927,0002,449,408
13Jun 13, 2021 05:327,56993,080,27846,046,00016,016,0002,490,368
14Jun 13, 2021 05:327,63689,305,90447,468,00015,149,0002,498,560
15Jun 13, 2021 05:327,68089,816,47745,980,00016,992,0002,494,464
16Jun 13, 2021 05:327,68893,840,74544,030,00019,013,0002,383,872
17Jun 13, 2021 05:328,00595,741,80347,736,00017,901,0002,502,656
18Jun 13, 2021 05:298,307131,477,48468,113,60502,240,512
19Jun 13, 2021 05:328,84095,978,06955,370,00017,114,0002,486,272