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 listSep 7, 2022 05:13Yuriy 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
1Sep 7, 2022 05:4000000Error: expected "2209324016 ", got "2147483648 "stderr
2Sep 7, 2022 05:3900000Error: expected "2218340800 ", got "2147483648 "stderr
3Sep 7, 2022 05:3900000Error: expected "2203921656 ", got "2147483648 "stderr
4Sep 7, 2022 05:3800000Error: expected "2213032298 ", got "2147483648 "stderr
5Sep 7, 2022 05:1200000Error: expected "1946331707 ", got "3269125118 "stderr
6Sep 7, 2022 05:135,060578,061,32736,431,0005,059,0002,437,120
7Sep 7, 2022 05:135,163572,746,67036,287,0006,047,0002,318,336
8Sep 7, 2022 05:135,270570,704,92132,161,00011,055,0002,322,432
9Sep 7, 2022 05:135,314568,602,32235,465,0008,106,0002,400,256
10Sep 7, 2022 05:135,320567,471,57137,676,0005,948,0002,383,872
11Sep 7, 2022 05:135,370571,833,13836,027,0008,006,0002,318,336
12Sep 7, 2022 05:135,430570,682,16939,463,0005,059,0002,461,696
13Sep 7, 2022 05:135,515570,751,60533,162,00012,059,0002,490,368
14Sep 7, 2022 05:135,530596,749,78145,350,08102,224,128
15Sep 7, 2022 05:135,625602,061,41346,127,20202,228,224
16Sep 7, 2022 05:135,649609,301,09046,318,76302,232,320
17Sep 7, 2022 05:135,696577,562,14737,764,0008,944,0002,342,912