結果

問題 No.857 素振り
コンテスト
ユーザー pazzle1230
提出日時 2019-08-09 21:22:19
言語 Rust
(1.99.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 1,000 ms
+ 32µs
コード長 654 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,473 ms
コンパイル使用メモリ 176,464 KB
実行使用メモリ 9,836 KB
最終ジャッジ日時 2026-11-27 21:37:55
合計ジャッジ時間 5,089 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `std::collections::HashSet`
 --> src/main.rs:1:5
  |
1 | use std::collections::HashSet;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

ソースコード

diff #
raw source code

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