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 21, 2021 18:03Yuriy 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 2, 2022 17:3700000Error: expected "2077886582 ", got "4179843538 "stderr
2Aug 21, 2021 18:0300000Error: expected "2199210338 ", got "2147483648 "stderr
3Aug 21, 2021 18:0400000Error: expected "2284878627 ", got "2147483648 "stderr
4Aug 21, 2021 18:0400000Error: died or killed
5Aug 21, 2021 18:0500000Error: expected "2200984480 ", got "2147483648 "stderr
6Aug 21, 2021 18:0500000Error: expected "2077380951 ", got "1797755542 "stderr
7Aug 21, 2021 18:0600000Error: died or killed
8Aug 2, 2022 17:3700000Error: expected "2060706881 ", got "647374176 "stderr
9Aug 21, 2021 18:0800000Error: expected "2067387539 ", got "2339314114 "stderr
10Aug 21, 2021 18:0700000Error: expected "2263904513 ", got "2147483648 "stderr
11Aug 21, 2021 18:0600000Error: expected "2226816216 ", got "2147483648 "stderr
12Sep 7, 2022 05:106,727125,244,11055,163,11602,215,936
13Aug 21, 2021 18:096,761125,780,31255,442,07602,265,088
14Aug 21, 2021 18:096,761123,317,35355,438,92602,240,512
15Aug 21, 2021 18:096,778116,356,00255,582,56302,220,032
16Aug 2, 2022 17:396,811122,088,47655,850,78402,228,224
17Sep 7, 2022 05:106,816120,589,44355,887,57902,224,128
18Sep 7, 2022 05:106,84380,414,31239,080,00017,035,0002,318,336
19Aug 2, 2022 17:396,849129,779,90456,164,53202,224,128
20Aug 2, 2022 17:396,870112,993,72756,334,25002,224,128
21Sep 7, 2022 05:106,87687,451,13040,274,00016,109,0002,428,928
22Sep 7, 2022 05:106,89884,682,48337,372,00019,191,0002,334,720
23Sep 7, 2022 05:106,90587,150,00838,422,00018,200,0002,334,720
24Sep 7, 2022 05:106,91185,705,39740,482,00016,192,0002,514,944
25Sep 7, 2022 05:106,919129,314,06056,736,43802,232,320
26Sep 7, 2022 05:106,92585,030,39337,858,00018,929,0002,281,472
27Sep 7, 2022 05:106,93780,420,05038,920,00017,963,0002,498,560
28Sep 7, 2022 05:106,95789,424,05444,034,00013,010,0002,490,368
29Aug 21, 2021 18:086,965115,094,56857,109,78002,224,128
30Aug 21, 2021 18:086,998115,858,99157,384,59202,228,224
31Sep 7, 2022 05:107,02385,884,43139,403,00018,186,0002,490,368
32Aug 21, 2021 18:087,077125,818,72858,032,69102,220,032
33Aug 21, 2021 18:037,192125,156,60558,974,22902,215,936
34Aug 21, 2021 18:037,25186,027,76542,329,00017,133,0002,494,464
35Aug 21, 2021 18:037,288118,599,49159,761,43702,224,128
36Aug 21, 2021 18:037,31687,641,09944,991,00014,997,0002,322,432
37Aug 21, 2021 18:037,33192,090,34242,078,00018,033,0002,387,968
38Aug 21, 2021 18:037,355128,459,97260,307,13002,220,032
39Aug 21, 2021 18:037,41789,830,78045,867,00014,956,0002,494,464
40Aug 21, 2021 18:037,44784,734,33344,046,00017,018,0002,523,136
41Aug 21, 2021 18:037,45788,872,18346,109,00015,035,0002,498,560
42Aug 21, 2021 18:037,47687,866,43344,218,00017,084,0002,351,104
43Aug 21, 2021 18:037,57186,638,54044,056,00018,023,0002,494,464
44Aug 21, 2021 18:037,67486,892,56743,947,00018,977,0002,486,272