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 22, 2024 15:47Andrey LikhachevAndrey LikhachevError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 18, 2024 07:3100000Error: Exit with code 101: thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 18446744073709551494 greater than length of slice 93559 note: run with `RUST_BACKTRACE...stderr
2Jul 22, 2024 15:4600000Error: Exit with code 101: thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 125880 greater than length of slice 101181 note: run with `RUST_BACKTRACE=1` environme...stderr
3Jul 22, 2024 15:473,18846,489,50025,133,0001,005,0002,314,240
4Jul 22, 2024 15:473,18947,123,15123,134,0003,017,0002,441,216
5Jul 22, 2024 15:473,19046,643,24924,148,0002,012,0002,428,928
6Jul 22, 2024 15:473,19155,083,28025,158,0001,006,0002,449,408
7Jul 22, 2024 15:473,20347,443,71125,254,0001,010,0002,322,432
8Jul 22, 2024 15:473,21948,555,96626,395,00002,404,352
9Jul 22, 2024 15:473,22054,685,50926,400,00002,428,928
10Jul 22, 2024 15:473,22252,088,00225,407,0001,016,0002,441,216
11Jul 22, 2024 15:473,22553,986,65626,441,00002,428,928
12Jul 22, 2024 15:473,391106,096,04727,806,74702,199,552
13Jul 22, 2024 14:563,39789,617,54627,851,32502,260,992
14Jul 22, 2024 15:463,407107,741,33627,940,06902,265,088
15Jul 22, 2024 15:463,40899,143,57127,944,45902,252,800
16Jul 22, 2024 14:563,414106,149,84527,993,76902,256,896
17Jul 22, 2024 14:563,425101,186,93228,087,07102,244,608
18Jul 22, 2024 15:473,429102,947,41428,114,13802,244,608
19Jul 22, 2024 15:473,441111,233,80728,213,86202,252,800
20Jul 22, 2024 15:463,44597,271,55728,246,22702,277,376