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 20, 2022 07:07Bernard TeoBernard TeoError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 20, 2022 07:0700000Error: expected "2114505347 ", got "2"
2Nov 20, 2022 07:0700000Error: expected "1950283793 ", got "1"
3Nov 20, 2022 07:0600000Error: expected "2283475362 ", got "1"
4Nov 20, 2022 07:079,951108,034,09274,548,0007,051,0002,310,144
5Nov 20, 2022 07:0710,462116,896,31176,809,0008,977,0002,293,760
6Nov 20, 2022 07:0710,480110,994,46975,943,0009,992,0002,498,560
7Nov 20, 2022 07:0710,548113,173,69875,432,00011,063,0002,420,736
8Nov 20, 2022 07:0710,669108,531,07580,449,0007,039,0002,441,216
9Nov 20, 2022 07:0710,896146,587,14089,347,87302,179,072
10Nov 20, 2022 07:0710,962113,783,69976,903,00012,983,0002,510,848
11Nov 20, 2022 07:0710,977140,881,25790,015,42102,301,952
12Nov 20, 2022 07:0710,996141,319,24590,168,24002,183,168
13Nov 20, 2022 07:0711,019145,832,30790,356,37302,220,032
14Nov 20, 2022 07:0711,061164,975,13190,700,56802,199,552
15Nov 20, 2022 07:0711,106158,643,41991,073,04602,265,088
16Nov 20, 2022 07:0711,124113,066,87478,185,00013,030,0002,310,144
17Nov 20, 2022 07:0711,155163,222,61791,471,75502,273,280
18Nov 20, 2022 07:0711,443117,330,59379,856,00013,974,0002,428,928
19Nov 20, 2022 07:0711,506120,780,96685,314,0009,033,0002,355,200
20Nov 20, 2022 07:0711,821171,199,33096,930,25402,207,744
21Nov 20, 2022 07:0711,995159,453,79898,360,47602,236,416