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 listOct 20, 2026 07:09e1011e1011Error
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 20, 2026 07:11034,255,85312,038,00011,335,0002,113,536expected "429496529486 ", got "Sample size: 100000 Min: 21662 Q1: 1014791199 Median: 2155900170 Q3: 3127810484 Max: 4294864165 P99: 4250032719 P99.9: 4291237442 "
2Oct 20, 2026 07:11033,521,57512,092,00010,186,0002,113,536expected "429496538784 ", got "Sample size: 100000 Min: 169259 Q1: 1113358702 Median: 2228723481 Q3: 3340641236 Max: 4294965993 P99: 4253006244 P99.9: 4290351027 "
3Oct 20, 2026 07:11033,960,32612,095,00010,558,0002,113,536expected "429496497427 ", got "Sample size: 100000 Min: 47006 Q1: 1038859719 Median: 2123764624 Q3: 3167050007 Max: 4294911948 P99: 4248774789 P99.9: 4290897472 "