Parse integers Sergey Svistunov

Compute the sum of integers read from STDIN as fast as possible.

Input: 50 000 000 lines, each containing one integer in the range [0; 2147483647].

629871117
2024562523
1372689083
1021777120
2111176472

Output: The uint64 sum of all numbers, printed as a decimal string.

Note: Integer overflow is expected – use a 64-bit accumulator.

Back to listOct 9, 2024 02:37MikeMikeError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 9, 2024 02:3700000Error: Exit with code 2: panic: runtime error: slice bounds out of range [:2097152] with capacity 1048576 goroutine 7 [running]: bufio.(*Reader).ReadSlice(0xc000048180, 0xa) /tmp/go1.23.2/go/src/bufio/bufio.go:351 +0x22e bufio.(*Reader).collectFragme...stderr