結果

問題 No.2937 Sigma Plus Problem
ユーザー naut3
提出日時 2024-10-20 20:54:58
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 300 ms
コード長 584 bytes
コンパイル時間 12,393 ms
コンパイル使用メモリ 407,272 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-20 20:55:45
合計ジャッジ時間 13,782 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#![allow(non_snake_case, unused_must_use, unused_imports)]
use std::io::{self, prelude::*};

fn main() {
    let (stdin, stdout) = (io::read_to_string(io::stdin()).unwrap(), io::stdout());
    let (mut stdin, mut buffer) = (stdin.split_whitespace(), io::BufWriter::new(stdout.lock()));
    macro_rules! input {
        ($t: ty, $n: expr) => {
            (0..$n).map(|_| input!($t)).collect::<Vec<_>>()
        };
        ($t: ty) => {
            stdin.next().unwrap().parse::<$t>().unwrap()
        };
    }

    let a = input!(u128);
    writeln!(buffer, "{}", a * (a + 1) / 2);
}
0