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 15, 2024 03:28Matt StuchlikMatt StuchlikError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 15, 2024 03:2900000Error: expected "2268304379 ", got "0 "stderr
2Nov 15, 2024 03:2800000Error: No answer to stdout. Died or killed?stderr
3Nov 15, 2024 03:2800000Error: expected "2311700147 ", got "0 "stderr
4Nov 11, 2024 07:4300000Error: No answer to stdout. Died or killed?stderr
5Nov 11, 2024 07:4000000Error: expected "2305832492 ", got "0 "stderr
6Nov 11, 2024 07:4100000Error: No answer to stdout. Died or killed?stderr
7Nov 11, 2024 07:4300000Error: expected "2240577095 ", got "0 "stderr
8Nov 11, 2024 07:427,74694,517,64957,469,0006,049,0002,461,696
9Nov 11, 2024 07:417,92086,594,89260,946,0003,996,0002,527,232
10Nov 11, 2024 07:428,37696,492,09660,605,0008,080,0002,400,256
11Nov 11, 2024 07:418,39992,744,02966,876,0001,996,0002,453,504
12Nov 11, 2024 07:398,44690,857,03565,244,0004,015,0002,314,240
13Nov 11, 2024 07:418,743103,766,26963,727,0007,965,0002,347,008
14Nov 11, 2024 07:428,787100,349,72368,051,0004,003,0002,351,104
15Nov 15, 2024 03:288,976105,294,02466,547,0007,058,0002,318,336
16Nov 11, 2024 07:399,04197,599,24770,127,0004,007,0002,506,752
17Nov 11, 2024 07:399,43396,350,78871,325,0006,027,0002,535,424
18Nov 15, 2024 03:289,991106,391,52574,934,0006,993,0002,498,560
19Nov 15, 2024 03:2810,092106,514,79078,769,0003,988,0002,457,600