結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー halshiphalship
提出日時 2017-06-15 16:03:09
言語 Rust
(1.77.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 889 ms
コンパイル使用メモリ 164,856 KB
実行使用メモリ 6,968 KB
最終ジャッジ日時 2023-10-25 06:55:13
合計ジャッジ時間 1,744 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 5 ms
4,348 KB
testcase_09 AC 5 ms
4,348 KB
testcase_10 AC 10 ms
5,980 KB
testcase_11 AC 10 ms
6,000 KB
testcase_12 AC 10 ms
6,020 KB
testcase_13 AC 10 ms
6,036 KB
testcase_14 AC 11 ms
6,320 KB
testcase_15 AC 11 ms
6,340 KB
testcase_16 AC 12 ms
6,968 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io;

fn main() {
    let mut n = String::new();
    io::stdin().read_line(&mut n).unwrap();
    let n: usize = n.trim().parse().unwrap();

    let mut a = String::new();
    io::stdin().read_line(&mut a).unwrap();
    let a: Vec<u64> = a.trim().split_whitespace()
        .map(|s| s.parse().unwrap()).collect();

    let sum: u64 = a.into_iter().take(n).sum();
    println!("{}", sum);
}
0