結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー halship
提出日時 2017-06-15 16:03:09
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 397 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,231 ms
コンパイル使用メモリ 187,436 KB
実行使用メモリ 7,040 KB
最終ジャッジ日時 2026-04-12 05:54:06
合計ジャッジ時間 3,027 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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