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:39Andrey 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 23, 2024 21:3900000Error: Exit with code 101: seek: 926ns mmap: 1.145714ms lower: 2164260864/499553 upper: 2168455168/500663 thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 1844674...stderr
2Jun 23, 2024 21:4400000Error: Exit with code 101: seek: 849ns mmap: 1.142902ms lower: 2224029696/499465 upper: 2229272576/500639 thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 133776 ...stderr
3Jun 23, 2024 21:4400000Error: Exit with code 101: seek: 1.175µs mmap: 1.137015ms lower: 2112880640/499306 upper: 2119172096/500802 thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 1588...stderr
4Jun 23, 2024 21:404,42399,249,52636,269,63302,293,760
5Jun 23, 2024 21:454,428117,492,10836,305,51802,310,144
6Jun 23, 2024 21:454,433103,430,58136,353,80502,326,528
7Jun 23, 2024 21:404,446104,836,66436,453,85702,269,184
8Jun 23, 2024 21:454,47599,541,90936,695,55502,269,184
9Jun 23, 2024 21:404,511114,972,70536,990,16102,285,568