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 listJul 17, 2023 00:23Yuriy 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
1Jul 17, 2023 00:2500000Error: expected "2164469725 ", got "2147483648 "stderr
2Jul 17, 2023 00:3800000Error: expected "2166888095 ", got "2147483648 "stderr
3Jul 17, 2023 00:3800000Error: No answer to stdout. Died or killed?stderr
4Jul 17, 2023 00:3900000Error: expected "2229036329 ", got "2147483648 "stderr
5Jul 17, 2023 00:3900000Error: expected "2251294127 ", got "2147483648 "stderr
6Jul 17, 2023 00:3900000Error: expected "2191160296 ", got "2147483648 "stderr
7Jul 17, 2023 00:264,017595,637,89232,941,74202,260,992
8Jul 17, 2023 00:264,024597,751,04333,000,55102,252,800
9Jul 17, 2023 00:264,053599,314,40133,234,33802,289,664
10Jul 17, 2023 00:244,133604,617,14933,890,84102,232,320
11Jul 17, 2023 00:244,150595,096,86734,031,27902,203,648
12Jul 17, 2023 00:244,176591,822,66934,243,05402,326,528
13Jul 17, 2023 00:234,638604,083,93038,029,28902,306,048
14Jul 17, 2023 00:234,679602,666,88938,368,89602,199,552
15Jul 17, 2023 00:234,748598,553,57538,936,68602,207,744