結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー Yusuke WadaYusuke Wada
提出日時 2020-07-09 16:24:33
言語 Rust
(1.77.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 691 ms
コンパイル使用メモリ 149,760 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-16 16:52:51
合計ジャッジ時間 1,802 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 0 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 5 ms
5,376 KB
testcase_09 AC 7 ms
5,376 KB
testcase_10 AC 14 ms
8,960 KB
testcase_11 AC 15 ms
9,088 KB
testcase_12 AC 16 ms
9,344 KB
testcase_13 AC 15 ms
9,600 KB
testcase_14 AC 16 ms
9,856 KB
testcase_15 AC 16 ms
9,856 KB
testcase_16 AC 18 ms
10,752 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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 s2 = getline();
    let e1: Vec<_> = s1.trim().split(' ').collect();
    let e2: Vec<_> = s2.trim().split(' ').collect();
    let n: i32 = e1[0].parse().unwrap();
    let mut sum: u64 = 0;

    for i in 0..n {
        let num = e2[i as usize].parse::<u64>().unwrap();
        sum += num
    }

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