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 listApr 17, 2023 06:56Yuriy LyfenkoYuriy LyfenkoError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 17, 2023 06:5600000Error: expected "2309963762 ", got "2147483648 "stderr
2Apr 17, 2023 06:5600000Error: expected "2010758329 ", got "3278314329 "stderr
3Apr 17, 2023 06:5900000Error: expected "2212737735 ", got "2147483648 "stderr
4Apr 17, 2023 06:5900000Error: expected "2046445202 ", got "2651830589 "stderr
5Apr 17, 2023 06:574,939593,472,36740,500,97802,232,320
6Apr 17, 2023 06:574,996598,429,54440,966,14102,289,664
7Apr 17, 2023 06:575,039600,555,96741,316,45202,260,992