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 16, 2021 09:24Dmitry DolgopolovDmitry DolgopolovError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 16, 2021 09:2400000Error: expected "2159378532 ", got "4294967295 "stderr
2Jun 16, 2021 09:2500000Error: expected "2187499537 ", got "4294967295 "stderr
3Jun 16, 2021 09:2600000Error: expected "2146929983 ", got "4294967295 "stderr
4Jun 16, 2021 21:2100000Error: expected "2250508657 ", got "2252851912 "stderr
5Jun 16, 2021 21:2500000Error: expected "2169735079 ", got "2170615602 "stderr
6Jun 16, 2021 21:2800000Error: expected "2078766663 ", got "4294967295 "stderr