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 listDec 12, 2024 18:29Yuriy 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
1Dec 12, 2024 18:2800000Error: expected "2140952000 ", got "2147483648 "stderr
2Dec 12, 2024 18:2600000Error: expected "2126077373 ", got "3687876864 "stderr
3Sep 3, 2024 19:2800000Error: expected "2085246165 ", got "2147483648 "stderr
4Sep 3, 2024 19:2700000Error: expected "2054870186 ", got "2147483648 "stderr
5Sep 3, 2024 19:273,91553,702,46628,090,0004,012,0002,359,296
6Sep 3, 2024 19:273,94753,114,99630,344,0002,022,0002,527,232
7Dec 12, 2024 18:263,95055,414,52129,351,0003,036,0002,478,080
8Sep 3, 2024 19:273,95952,021,51131,448,0001,014,0002,449,408
9Dec 12, 2024 18:263,95954,825,07130,433,0002,028,0002,371,584
10Dec 12, 2024 18:263,95956,518,02231,453,0001,014,0002,428,928
11Sep 3, 2024 19:273,96057,234,76330,445,0002,029,0002,277,376
12Dec 12, 2024 18:263,96861,546,80131,521,0001,016,0002,416,640
13Dec 12, 2024 18:263,96856,155,99330,505,0002,033,0002,396,160
14Sep 3, 2024 19:273,97261,446,02030,533,0002,035,0002,490,368
15Dec 12, 2024 18:293,97562,433,24130,562,0002,037,0002,297,856
16Sep 3, 2024 19:273,97661,568,06930,567,0002,037,0002,469,888
17Sep 3, 2024 19:273,97760,198,32930,577,0002,038,0002,433,024
18Dec 12, 2024 18:293,98657,847,19729,619,0003,064,0002,392,064
19Sep 3, 2024 19:273,98958,160,85930,662,0002,044,0002,269,184
20Dec 12, 2024 18:264,00461,141,26029,851,0002,985,0002,416,640
21Dec 12, 2024 18:264,00558,346,08629,857,0002,985,0002,453,504
22Sep 3, 2024 19:274,00656,908,53429,866,0002,986,0002,367,488
23Dec 12, 2024 18:264,00758,385,65530,863,0001,991,0002,510,848
24Dec 12, 2024 18:264,00957,266,68828,888,0003,984,0002,527,232
25Dec 12, 2024 18:294,13055,881,15231,810,0002,052,0002,428,928