結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー Yusuke Wada
提出日時 2020-07-09 16:29:53
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 55 ms / 3,000 ms
コード長 489 bytes
コンパイル時間 15,633 ms
コンパイル使用メモリ 399,708 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-07 15:06:58
合計ジャッジ時間 14,612 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

fn getline() -> String {
    let mut __ret = String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}

fn main() {
    let s1 = getline();
    let e1: Vec<_> = s1.trim().split(' ').collect();
    let n: i32 = e1[0].parse().unwrap();
    let mut sum: u64 = 0;

    for _ in 0..n {
        let s = getline();
        let e: Vec<_> = s.trim().split(' ').collect();
        let num = e[0].parse::<u64>().unwrap();
        sum += num
    }

    println!("{}", sum)
}
0