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 2, 2022 18:51Yuriy 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
1Aug 2, 2022 18:5100000Error: expected "2238474318 ", got "2147483648 "stderr
2Aug 2, 2022 18:5200000Error: expected "2204327927 ", got "2147483648 "stderr
3Aug 2, 2022 18:5200000Error: expected "2248607473 ", got "2147483648 "stderr
4Aug 2, 2022 18:525,142102,232,51142,168,49402,220,032
5Aug 2, 2022 18:525,161109,258,91842,316,31402,220,032
6Aug 3, 2022 01:345,208110,436,31842,705,82002,228,224
7Aug 2, 2022 18:525,375106,230,86244,073,47002,244,608
8Aug 3, 2022 01:345,379124,138,97144,109,50502,220,032
9Aug 3, 2022 01:345,403118,857,04344,303,28602,248,704