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 listAug 18, 2024 07:31Andrey 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 18446744073709549385 greater than length of slice 107637 note: run with `RUST_BACKTRAC...stderr
2Aug 31, 2024 19:0000000Error: Exit with code 101: thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/slice/select.rs:135:9: partition_at_index index 18446744073709541955 greater than length of slice 107325 note: run with `RUST_BACKTRAC...stderr
3Aug 31, 2024 19:003,17254,864,73724,011,0002,000,0002,469,888
4Aug 31, 2024 19:003,19648,359,12924,190,0002,015,0002,428,928
5Aug 31, 2024 19:003,24151,656,66225,552,0001,022,0002,412,544
6Aug 18, 2024 07:313,405106,783,06327,922,27602,285,568
7Aug 18, 2024 07:313,415108,495,38328,004,45402,277,376
8Aug 18, 2024 07:313,449119,461,70528,278,61702,297,856