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 listJun 24, 2024 16:02Andrey LikhachevAndrey LikhachevError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 13:33Victor Mercklé12.93CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 13:33070,392,24059,859,0001,071,00024,576Exit with code 101: seek: 1.057µs mmap: 226.572µs thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 50000000 greater than length of slice 0 note: run with `RUST_...stderr
2Jun 24, 2024 16:023,68854,650,59228,229,0002,016,0002,371,584
3Jun 24, 2024 16:023,69855,544,56328,300,0002,021,0002,478,080
4Jun 24, 2024 16:023,69853,891,65829,314,0001,010,0002,412,544
5Jun 24, 2024 16:023,72255,068,56229,501,0001,017,0002,363,392
6Jun 24, 2024 16:023,72554,128,91729,525,0001,018,0002,355,200
7Jun 24, 2024 16:023,73655,911,95629,614,0001,021,0002,326,528
8Jun 24, 2024 16:023,73957,772,69429,640,0001,022,0002,338,816
9Jun 24, 2024 16:023,76259,184,81929,850,000995,0002,322,432
10Jun 24, 2024 16:023,76459,606,11930,866,00002,465,792
11Jun 24, 2024 16:023,87593,977,67231,776,97902,269,184
12Jun 24, 2024 16:023,926109,600,09432,196,44602,215,936
13Jun 24, 2024 16:023,94193,225,26032,314,89002,306,048