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 13, 2022 20:27Yuriy 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
1Oct 13, 2022 20:2700000Error: expected "2235083523 ", got "2147483648 "stderr
2Oct 13, 2022 20:2800000Error: expected "2014773414 ", got "3548483893 "stderr
3Oct 13, 2022 20:3800000Error: expected "2032575407 ", got "109341937 "stderr
4Oct 13, 2022 20:4000000Error: expected "2050561951 ", got "2196277016 "stderr
5Oct 13, 2022 20:4100000Error: expected "2015296554 ", got "1828118610 "stderr
6Oct 13, 2022 20:4500000Error: expected "2211141240 ", got "2147483648 "stderr
7Oct 13, 2022 20:464,910612,965,75340,259,49702,306,048
8Oct 13, 2022 20:464,967605,618,96140,725,72302,236,416
9Oct 13, 2022 20:465,193600,197,67842,584,29402,207,744