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 19, 2022 18:01Bernard 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 19, 2022 18:0200000Error: expected "2284944131 ", got "1"
2Nov 19, 2022 18:0100000Error: expected "1977978331 ", got "1"
3Nov 19, 2022 18:0113,694190,502,348112,291,72302,244,608
4Nov 19, 2022 18:0214,875194,225,966121,976,76402,252,800
5Nov 19, 2022 18:0015,066192,873,268123,540,77402,191,360
6Nov 19, 2022 18:0115,367190,947,240126,005,31802,228,224
7Nov 19, 2022 18:0115,628186,524,903128,150,77602,265,088
8Nov 19, 2022 18:0215,732197,493,418129,001,50202,232,320
9Nov 19, 2022 18:0015,924204,295,890130,575,23902,191,360
10Nov 19, 2022 18:0216,040200,187,351131,527,67602,199,552
11Nov 19, 2022 18:0116,074193,758,984131,804,30402,285,568
12Nov 19, 2022 18:0116,184194,239,284132,712,32702,248,704
13Nov 19, 2022 18:0116,220200,862,242133,003,98502,273,280
14Nov 19, 2022 18:0116,429207,940,423134,718,27302,293,760
15Nov 19, 2022 18:0116,460207,125,892134,972,13002,199,552
16Nov 19, 2022 18:0016,577205,108,202135,932,02602,203,648
17Nov 19, 2022 18:0117,568223,139,821144,054,31202,191,360