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 listApr 9, 2023 16:38Franek KortaFranek KortaError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 9, 2023 16:3900000Error: expected "429496389992 ", got "373661891436 "stderr
2Apr 9, 2023 16:3973,45449,831,76326,172,0001,006,0002,531,328
3Apr 9, 2023 16:3974,33053,287,88127,502,00002,437,120
4Apr 9, 2023 16:3974,51947,458,40625,530,0002,042,0002,441,216
5Apr 9, 2023 16:3874,71955,871,16927,646,00002,449,408
6Apr 9, 2023 16:3974,83853,364,84427,690,00002,531,328
7Apr 9, 2023 16:3974,90352,241,58827,714,00002,531,328
8Apr 9, 2023 16:3875,26253,250,15726,853,000994,0002,441,216
9Apr 9, 2023 16:3875,27055,079,23425,861,0001,989,0002,453,504
10Apr 9, 2023 16:3875,35158,520,01324,893,0002,987,0002,269,184
11Apr 9, 2023 16:3876,14953,653,91827,169,0001,006,0002,445,312
12Apr 9, 2023 16:3876,15450,522,92126,165,0002,012,0002,441,216
13Apr 9, 2023 16:3976,28456,666,58627,217,0001,008,0002,433,024
14Apr 9, 2023 16:3976,37349,710,89226,240,0002,018,0002,527,232
15Apr 9, 2023 16:3976,90549,923,66927,439,0001,016,0002,527,232
16Apr 9, 2023 16:3876,96548,106,92127,460,0001,017,0002,449,408
17Apr 9, 2023 16:3877,14353,806,06628,543,00002,531,328
18Apr 9, 2023 16:3877,28158,245,30227,573,0001,021,0002,269,184
19Apr 9, 2023 16:3978,02753,761,76526,879,0001,991,0002,531,328
20Apr 9, 2023 16:3985,79783,856,44331,744,82502,293,760
21Apr 9, 2023 16:3986,16186,105,23331,879,73202,301,952
22Apr 9, 2023 16:3886,41391,171,19931,972,69502,297,856
23Apr 9, 2023 16:3886,494106,135,16632,002,88602,174,976
24Apr 9, 2023 16:3886,98088,534,73532,182,51902,301,952
25Apr 9, 2023 16:3987,61294,161,08732,416,41502,174,976