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 listApr 24, 2024 19:24Joad NacerJoad NacerError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2024 19:2400000Error: expected "2017527844 ", got "0"
2Apr 24, 2024 19:2300000Error: expected "2034325858 ", got "0"
3Apr 24, 2024 19:2459,228540,236,201485,667,76502,252,800
4Apr 24, 2024 19:2459,276544,113,289486,063,63102,244,608
5Apr 24, 2024 19:2459,520548,145,288488,065,80202,260,992
6Apr 24, 2024 19:24126,7821,099,011,1261,039,615,01202,240,512
7Apr 24, 2024 19:24140,2631,204,784,3401,150,159,15102,248,704
8Apr 24, 2024 19:24142,2411,226,405,4091,166,375,14602,252,800
9Apr 24, 2024 19:24142,9661,235,958,9091,172,325,06802,252,800
10Apr 24, 2024 19:24143,4831,228,871,2101,176,559,69902,252,800
11Apr 24, 2024 19:24145,6261,255,290,9381,194,135,94602,248,704
12Apr 24, 2024 19:24146,3151,266,190,8711,199,781,55802,248,704
13Apr 24, 2024 19:24147,8761,278,012,2841,212,579,15102,256,896
14Apr 24, 2024 19:24149,1041,283,179,9401,222,651,51402,252,800
15Apr 24, 2024 19:24151,5051,324,634,6791,242,340,30202,240,512
16Apr 24, 2024 19:24151,5221,303,055,9911,242,478,52302,248,704
17Apr 24, 2024 19:24154,4851,330,449,0221,266,778,57802,240,512