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 listOct 2, 2026 23:47Karthik ReddyKarthik ReddyError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 2, 2026 23:47071,409,73561,264,0001,031,0002,117,632expected "2175749345 ", got "[122 123 0 999 113 148 499 4096][488 245 0 999 347 268 499 4096][854 123 0 999 630 311 500 4096][1465 122 0 999 519 347 500 4096][1709 122 0 999 295 253 500 4096][2075 123 0 999 386 316 499 4096][2319 245 0 999 517 170 500 ...
2Oct 2, 2026 23:47043,663,09633,412,0001,026,0002,117,632expected "2317287431 ", got "[0 122 0 999 397 126 499 4096][345 1 0 999 514 280 503 4096][611 1 0 999 481 284 494 4096][621 1 0 999 482 285 503 4096][624 1 0 999 480 284 502 4096][626 1 0 999 480 281 494 4096][629 2 0 999 482 284 499 4096][636 5 0 999 ...
3Oct 2, 2026 23:470103,032,56992,853,0001,124,0002,117,632expected "2133473664 ", got "[244 150 0 999 678 156 500 4096][395 10 0 999 515 300 499 4096][406 2 0 999 518 300 496 4096][409 79 0 999 518 300 500 4096][733 121 0 999 522 286 499 4096][1586 367 0 999 487 368 499 4096][2197 367 0 999 529 266 499 4096][...