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 listNov 21, 2022 17:45Bernard TeoBernard TeoError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 22, 2022 15:4700000Error: expected "1990385968 ", got "1"
2Nov 21, 2022 17:4500000Error: expected "2091980917 ", got "2"
3Nov 21, 2022 17:4500000Error: expected "2297565939 ", got "1"
4Nov 21, 2022 17:4500000Error: expected "1969172767 ", got "1"
5Nov 21, 2022 17:455,30364,730,12233,371,00010,112,0002,461,696
6Nov 21, 2022 17:455,30568,293,01235,408,0008,093,0002,433,024
7Nov 21, 2022 17:455,31367,586,55332,422,00011,145,0002,502,656
8Nov 21, 2022 17:455,34369,330,87238,837,0004,979,0002,514,944
9Nov 21, 2022 17:455,34674,021,14937,861,0005,978,0002,416,640
10Nov 21, 2022 17:455,38873,852,72439,158,0005,020,0002,363,392
11Nov 21, 2022 17:455,43168,172,33638,459,0006,072,0002,363,392
12Nov 21, 2022 17:455,55171,126,88935,402,00010,115,0002,351,104
13Nov 21, 2022 17:455,59668,693,20437,905,0007,980,0002,469,888
14Nov 21, 2022 17:455,774119,256,05147,350,06302,289,664
15Nov 21, 2022 17:455,782130,440,64247,415,08902,224,128
16Nov 21, 2022 17:455,809108,442,22847,631,79802,260,992
17Nov 21, 2022 17:455,861112,173,91248,058,01102,281,472
18Nov 21, 2022 17:455,901117,994,85648,386,99302,297,856
19Nov 21, 2022 17:455,938146,567,82348,693,84002,269,184
20Nov 22, 2022 15:475,965111,156,03748,916,22402,240,512
21Nov 22, 2022 15:475,997118,365,67149,176,77202,203,648
22Nov 22, 2022 15:476,006104,916,25149,246,21602,244,608