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 listNov 11, 2024 03:24Matt StuchlikMatt StuchlikError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 11, 2024 03:2800000Error: expected "2200271492 ", got "2200271496 "
2Nov 11, 2024 03:2700000Error: Exit with code 1: Index out of boundsstderr
3Nov 11, 2024 03:2700000Error: Exit with code 1: Index out of boundsstderr
4Nov 11, 2024 03:2500000Error: Exit with code 1: Index out of boundsstderr
5Nov 11, 2024 03:2910,841116,291,01584,903,0003,995,0002,277,376
6Nov 11, 2024 03:2910,854115,036,08579,006,00010,000,0002,457,600
7Nov 11, 2024 03:2911,154113,570,28887,444,0004,020,0002,412,544
8Nov 11, 2024 03:2911,562118,672,45885,828,0008,982,0002,412,544
9Nov 11, 2024 03:2911,712122,949,08187,036,0009,003,0002,502,656
10Nov 11, 2024 03:2912,213124,218,60992,138,0008,012,0002,400,256
11Nov 11, 2024 03:2912,406129,349,38092,757,0008,976,0002,330,624
12Nov 11, 2024 03:2913,385138,322,07995,785,00013,968,0002,437,120
13Nov 11, 2024 03:2914,050136,697,266105,196,00010,018,0002,498,560
14Nov 11, 2024 03:2614,209148,260,288110,489,0006,026,0002,498,560
15Nov 11, 2024 03:2614,291150,187,528103,163,00014,022,0002,416,640
16Nov 11, 2024 03:2614,301142,053,912105,244,00012,027,0002,400,256
17Nov 11, 2024 03:2615,114147,477,353110,940,00012,993,0002,383,872
18Nov 11, 2024 03:2615,681158,103,238118,537,00010,045,0002,375,680
19Nov 11, 2024 03:2615,750155,687,902122,145,0007,008,0002,318,336
20Nov 11, 2024 03:2616,107158,616,558119,073,00013,007,0002,269,184
21Nov 11, 2024 03:2616,986164,945,445129,263,00010,020,0002,359,296
22Nov 11, 2024 03:2617,077166,293,015127,029,00013,003,0002,404,352
23Nov 11, 2024 03:2418,324177,885,628137,237,00013,022,0002,379,776
24Nov 11, 2024 03:2420,533197,915,276150,331,00018,039,0002,490,368
25Nov 11, 2024 03:2422,567212,102,333172,049,00013,003,0002,281,472