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 21, 2021 06:57Andrey TsvetkovAndrey TsvetkovError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 21, 2021 06:5600000Error: expected "2118795077 ", got "2118795080 "stderr
2Jun 21, 2021 06:5800000Error: expected "2110656420 ", got "2110656429 "stderr
3Jun 21, 2021 06:5796,305840,841,886789,703,02302,224,128
4Jun 21, 2021 06:57103,358907,136,229847,536,34702,220,032
5Jun 21, 2021 06:57116,2261,012,661,860953,056,68602,215,936