結果

問題 No.857 素振り
ユーザー pazzle1230pazzle1230
提出日時 2019-08-09 21:22:19
言語 Rust
(1.72.1)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 654 bytes
コンパイル時間 1,076 ms
コンパイル使用メモリ 140,924 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-26 16:56:31
合計ジャッジ時間 1,492 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `std::collections::HashSet`
 --> Main.rs:1:5
  |
1 | use std::collections::HashSet;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: 1 warning emitted

ソースコード

diff #

use std::collections::HashSet;

#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim().split_whitespace()
        .map(|x| x.parse().ok().unwrap()).collect()
}

fn main() {
    let xyz = read_vec::<u64>();
    let mut res = xyz[2];
    if xyz[2] >= xyz[0] {
        res -= 1;
    }
    if xyz[2] >= xyz[1] {
        res -= 1;
    }
    println!("{}", res);
}
0