結果

問題 No.3677 Global Checksum
コンテスト
ユーザー 👑 みうね
提出日時 2026-08-10 05:38:04
言語 Rust
(1.97.1 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 142 ms / 200 ms
+ 60µs
コード長 706 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,472 ms
コンパイル使用メモリ 182,800 KB
実行使用メモリ 46,208 KB
最終ジャッジ日時 2026-09-04 22:14:00
合計ジャッジ時間 14,596 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::{self, Read, Write};
fn main(){
    let mut input=Vec::new();io::stdin().read_to_end(&mut input).unwrap();let mut it=input.split(|b|b.is_ascii_whitespace());
    let h:usize=std::str::from_utf8(it.next().unwrap()).unwrap().parse().unwrap();let w:usize=std::str::from_utf8(it.next().unwrap()).unwrap().parse().unwrap();
    let mut sums=vec![0u32;h];let mut total=0u32;
    for s in &mut sums{for _ in 0..w{let x:u32=std::str::from_utf8(it.next().unwrap()).unwrap().parse().unwrap();*s=s.wrapping_add(x);}total=total.wrapping_add(*s);}
    let stdout=io::stdout();let mut out=io::BufWriter::with_capacity(1<<20,stdout.lock());for s in sums{writeln!(out,"{}",s.wrapping_add(total)).unwrap();}
}
0