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 listJul 16, 2023 21:53Yuriy 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
1Jul 16, 2023 22:1600000Error: expected "1935227435 ", got "2590691830 "stderr
2Jul 16, 2023 22:1400000Error: expected "2015364430 ", got "3046188636 "stderr
3Jul 16, 2023 21:5900000Error: expected "2259661152 ", got "2147483648 "stderr
4Jul 16, 2023 21:5800000Error: expected "2083839314 ", got "2600781984 "stderr
5Jul 16, 2023 21:5700000Error: expected "2341618704 ", got "2147483648 "stderr
6Jul 16, 2023 21:5700000Error: expected "1988162013 ", got "1844100115 "stderr
7Jul 16, 2023 21:5400000Error: expected "2013346441 ", got "483214952 "stderr
8Jul 16, 2023 21:5400000Error: expected "2291944297 ", got "2147483648 "stderr
9Jul 16, 2023 21:5400000Error: expected "2061011739 ", got "1712342030 "stderr
10Jul 16, 2023 21:5700000Error: expected "2038642828 ", got "2603580618 "stderr
11Jul 16, 2023 21:544,613594,275,71537,825,48902,318,336
12Jul 16, 2023 21:544,622602,062,21637,902,48202,277,376
13Jul 16, 2023 21:544,675597,379,83138,335,42702,211,840
14Jul 16, 2023 21:535,136608,202,53642,117,27902,326,528
15Jul 16, 2023 22:005,171602,296,19042,401,68102,256,896
16Jul 16, 2023 21:535,244608,747,90142,997,78902,297,856
17Jul 16, 2023 22:155,281617,988,69643,304,44302,301,952
18Jul 16, 2023 22:005,293615,927,92743,403,75902,203,648
19Jul 16, 2023 22:155,314613,431,48243,572,46202,199,552
20Jul 16, 2023 22:155,326609,153,01243,677,20402,215,936
21Jul 16, 2023 22:005,329617,827,00143,699,26602,240,512
22Jul 16, 2023 21:535,331617,587,90743,713,91702,289,664