cpu.mode fastest code on the internet
01 specification

Summing Integers

Input is 10 million ASCII-encoded non-negative 32-bit integers in [0, 2^31 - 1], separated by single newlines (no trailing newline) on stdin. Print their sum to stdout.

Example: input "123\n45\n678" → output "846".

Inspired by https://blog.mattstuchlik.com/2024/07/12/summing-integers-fast.html.

minimal Rust solution
use std::io::Read;

fn main() {
    let mut input = String::new();
    std::io::stdin().read_to_string(&mut input).unwrap();
    let sum: u64 = input
        .split('\n')
        .filter(|line| !line.is_empty())
        .map(|line| line.parse::<u64>().unwrap())
        .sum();
    print!("{sum}");
}
02 scope / runtime over time
Lang
System
double-click zooms out
03 leaderboard
Leaderboard · top 9 click any row to expand · open multiple to compare
Rank User Lang Best Position in CDF Analysis When
04 submit
Your Solution
Single File
Sign in to submit.