TopK Sergey Svistunov

Find the sum of the 100 largest values in 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 uint64 sum of the top 100 greatest values, printed as a decimal string.

Back to listJul 14, 2021 10:55Andrey TsvetkovAndrey TsvetkovError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 14, 2021 13:5700000Error: expected "429496494445 ", got "425201531982 "stderr
2Jul 14, 2021 13:5600000Error: expected "429496432177 ", got "347892152494 "stderr
3Jul 14, 2021 13:5600000Error: expected "429496473888 ", got "395136775065 "stderr
4Jul 14, 2021 10:5500000Error: expected "429496464298 ", got "408021652573 "stderr
5Jul 14, 2021 10:5500000Error: expected "429496480983 ", got "395136782438 "stderr
6Jul 14, 2021 10:5500000Error: expected "429496466815 ", got "403726692431 "stderr
7Jul 14, 2021 10:5500000Error: expected "429496447769 ", got "352187133510 "stderr
8Jul 14, 2021 10:5500000Error: expected "429496445265 ", got "373661938154 "stderr
9Jul 14, 2021 10:5588,15596,348,10732,617,30302,256,896
10Jul 14, 2021 10:5788,18796,094,42232,629,06502,191,360
11Jul 14, 2021 10:5588,22790,079,90132,643,84002,191,360
12Jul 14, 2021 10:5588,29797,823,65832,669,72802,199,552
13Jul 14, 2021 10:5588,347105,867,40232,688,49202,187,264
14Jul 14, 2021 10:5788,448101,863,53732,725,68802,203,648
15Jul 14, 2021 10:5588,51496,280,29032,750,03802,187,264
16Jul 14, 2021 10:5588,801100,072,92232,856,51002,199,552
17Jul 14, 2021 10:5588,82491,502,58232,864,71302,187,264
18Jul 14, 2021 10:5588,992100,796,51032,927,16402,187,264
19Jul 14, 2021 10:5589,019107,726,55432,936,93302,179,072
20Jul 14, 2021 10:5589,07197,032,08832,956,28002,191,360
21Jul 14, 2021 10:5589,102102,859,48132,967,77202,199,552
22Jul 14, 2021 10:5789,127104,888,15132,977,07602,187,264
23Jul 14, 2021 10:5593,39996,579,70034,557,65102,199,552