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 listMay 6, 2024 23:50Joad NacerJoad NacerError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 6, 2024 23:5000000Error: expected "429496482735 ", got "382251901120 "
2May 6, 2024 23:5075,13250,284,73425,814,0001,985,0002,289,664
3May 6, 2024 23:5075,24655,637,55325,853,0001,988,0002,289,664
4May 6, 2024 23:5075,25956,271,73226,852,000994,0002,269,184
5May 6, 2024 23:5075,30053,119,00527,861,00002,289,664
6May 6, 2024 23:5075,30352,112,42225,872,0001,990,0002,375,680
7May 6, 2024 23:5075,32454,010,47325,880,0001,990,0002,273,280
8May 6, 2024 23:5075,36550,266,44125,894,0001,991,0002,383,872
9May 6, 2024 23:5075,45453,690,90625,924,0001,994,0002,289,664
10May 6, 2024 23:5075,64953,389,60625,991,0001,999,0002,289,664
11May 6, 2024 23:5078,40597,246,92429,009,91402,273,280
12May 6, 2024 23:5078,457104,813,90829,029,13002,277,376
13May 6, 2024 23:4978,469101,038,48929,033,37002,269,184
14May 6, 2024 23:4978,887104,730,15829,188,12302,273,280
15May 6, 2024 23:5078,94882,422,60829,210,93802,265,088
16May 6, 2024 23:4979,07789,036,75429,258,54902,269,184