結果

問題 No.1822 Keima of Shogi
ユーザー 小野寺健小野寺健
提出日時 2022-03-11 11:43:11
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 2,128 ms
コンパイル使用メモリ 129,224 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-13 14:55:34
合計ジャッジ時間 2,109 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,352 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 1 ms
4,352 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io;

fn main() {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf)
        .expect("Failed to read line");
    let n: i64 = buf.trim().parse()
        .expect("not integer");
    let l = (n-1) / 2 + 1;
    let ans = (l + 1) * l / 2;
    println!("{}", ans);
}
0