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
03
leaderboard
Leaderboard
· top 3
click any row to expand · open multiple to compare
Leaderboard:
,
,
Rank
User
Lang
Best · ms
Position in CDF
Delta
BEST
39.035ms
MAX RUN
39.389ms
CYCLES
198,047,367
INSTR
329,162,383
IPC
1.662
BRANCHES
37,095,119
BR MISSES
5,019,023
BR MISP
13.53%
L1 MISS
195,748
L2 MISS
8,511
L3 MISS
4,326
(max 39.389 ms)
view profile
BEST
70.589ms
MAX RUN
74.484ms
CYCLES
348,909,835
INSTR
1,075,048,397
IPC
3.081
BRANCHES
216,136,754
BR MISSES
5,850,744
BR MISP
2.71%
L1 MISS
493,854
L2 MISS
28,735
L3 MISS
14,877
(+31.554 ms, +80.8%, max 74.484 ms)
view profile
BEST
168.387ms
MAX RUN
172.756ms
CYCLES
788,692,893
INSTR
2,541,973,137
IPC
3.223
BRANCHES
617,511,440
BR MISSES
5,323,692
BR MISP
0.86%
L1 MISS
594,456
L2 MISS
237,482
L3 MISS
215,573
(+129.351 ms, +331.4%, max 172.756 ms)
view profile
Rank
User
Lang
Best · ms
Position in CDF
Delta
BEST
70.589ms
MAX RUN
74.484ms
CYCLES
348,909,835
INSTR
1,075,048,397
IPC
3.081
BRANCHES
216,136,754
BR MISSES
5,850,744
BR MISP
2.71%
L1 MISS
493,854
L2 MISS
28,735
L3 MISS
14,877
(max 74.484 ms)
view profile
BEST
168.387ms
MAX RUN
172.756ms
CYCLES
788,692,893
INSTR
2,541,973,137
IPC
3.223
BRANCHES
617,511,440
BR MISSES
5,323,692
BR MISP
0.86%
L1 MISS
594,456
L2 MISS
237,482
L3 MISS
215,573
(+97.797 ms, +138.5%, max 172.756 ms)
view profile
Rank
User
Lang
Best · ms
Position in CDF
Delta
BEST
39.035ms
MAX RUN
39.389ms
CYCLES
198,047,367
INSTR
329,162,383
IPC
1.662
BRANCHES
37,095,119
BR MISSES
5,019,023
BR MISP
13.53%
L1 MISS
195,748
L2 MISS
8,511
L3 MISS
4,326
(max 39.389 ms)
view profile
04
submit