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 listJun 13, 2021 20:35Yuriy 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
1Jun 13, 2021 20:3500000Error: expected "2284385864 ", got "2147483648 "stderr
2Jun 13, 2021 20:2900000Error: expected "2230900371 ", got "2147483648 "stderr
3Jun 13, 2021 20:3000000Error: expected "2257900886 ", got "2147483648 "stderr
4Jun 13, 2021 20:3000000Error: expected "2009536968 ", got "1644677465 "stderr
5Jun 13, 2021 20:3200000Error: expected "2308191327 ", got "2147483648 "stderr
6Jun 13, 2021 20:3300000Error: expected "2252497408 ", got "2147483648 "stderr
7Jun 13, 2021 20:346,626117,645,60854,329,32002,228,224
8Jun 13, 2021 20:346,650118,429,35954,529,75602,220,032
9Jun 13, 2021 20:336,651108,801,58954,538,88202,215,936
10Jun 13, 2021 20:346,668115,923,19354,674,18602,236,416
11Jun 13, 2021 20:336,700121,308,70554,938,93302,232,320
12Jun 13, 2021 20:336,748122,830,12355,334,36202,220,032
13Jun 13, 2021 20:356,751122,311,35355,358,75102,297,856
14Jun 13, 2021 20:356,772113,399,50755,528,02502,224,128
15Jun 13, 2021 20:326,775122,829,54155,552,24502,215,936
16Jun 13, 2021 20:356,83982,176,44540,059,00016,023,0002,498,560
17Jun 13, 2021 20:356,87681,047,36938,261,00018,123,0002,494,464
18Jun 13, 2021 20:356,87980,844,39640,290,00016,116,0002,523,136
19Jun 13, 2021 20:356,90585,166,19436,399,00020,221,0002,293,760
20Jun 13, 2021 20:326,912121,879,49856,675,87502,224,128
21Jun 13, 2021 20:326,921112,804,25456,751,67402,228,224
22Jun 13, 2021 20:356,92989,688,24337,880,00018,940,0002,314,240
23Jun 13, 2021 20:356,92989,572,23037,880,00018,940,0002,494,464
24Jun 13, 2021 20:356,95585,809,91838,022,00019,011,0002,490,368
25Jun 13, 2021 20:356,96885,975,86942,100,00015,035,0002,523,136
26Jun 13, 2021 20:357,014117,535,95657,512,24302,228,224
27Jun 13, 2021 20:357,01680,514,43139,365,00018,168,0002,351,104