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 23, 2024 21:00Andrey LikhachevAndrey LikhachevError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 9, 2026 10:19Tomislav Tunkovic28.45CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 9, 2026 10:20068,864,71738,311,00011,016,00028,672Exit with code 101: seek: 1.473µs mmap: 3.145787ms lower: 0/996225 upper: 0/996225 thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 50000000 greater than length ...stderr
2Jun 23, 2024 21:005,00466,882,80440,030,0001,000,0002,375,680
3Jun 23, 2024 21:005,00566,422,86339,041,0002,002,0002,400,256
4Jun 23, 2024 21:005,01366,000,40439,105,0002,005,0002,338,816
5Jun 23, 2024 21:005,02065,648,87139,157,0002,008,0002,338,816
6Jun 23, 2024 21:005,03165,537,49438,235,0003,018,0002,527,232
7Jun 23, 2024 21:005,03162,115,55539,243,0002,012,0002,355,200
8Jun 23, 2024 21:005,03162,022,09339,244,0002,012,0002,359,296
9Jun 23, 2024 21:005,03272,430,56640,259,0001,006,0002,416,640
10Jun 23, 2024 21:005,04667,652,68340,367,0001,009,0002,318,336
11Jun 23, 2024 21:345,191109,595,49042,567,10302,211,840
12Jun 23, 2024 21:005,222119,320,21642,817,19202,256,896
13Jun 23, 2024 21:005,245107,921,39643,007,58202,277,376
14Jun 23, 2024 21:005,251126,604,29243,057,37402,191,360
15Jun 23, 2024 21:345,252121,438,80143,069,43802,301,952
16Jun 23, 2024 21:345,265119,018,08543,168,98702,252,800