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:05Andrey 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
1Jun 24, 2024 16:0500000Error: Exit with code 101: seek: 954ns mmap: 1.13955ms thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 18446744073709516474 greater than length of slice 126631 n...stderr
2Jun 24, 2024 16:0600000Error: Exit with code 101: seek: 835ns mmap: 1.14431ms thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 18446744073709547868 greater than length of slice 133991 n...stderr
3Jun 24, 2024 16:0600000Error: Exit with code 101: seek: 884ns mmap: 1.142933ms thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 18446744073709545754 greater than length of slice 115357 ...stderr
4Jun 24, 2024 16:073,895108,528,59531,939,59802,240,512
5Jun 24, 2024 16:073,897101,360,52831,954,12902,211,840
6Jun 24, 2024 16:073,943102,921,81732,336,50202,195,456