結果
| 問題 |
No.857 素振り
|
| コンテスト | |
| ユーザー |
pazzle1230
|
| 提出日時 | 2019-08-09 21:22:19 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 654 bytes |
| コンパイル時間 | 14,246 ms |
| コンパイル使用メモリ | 379,364 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 10:58:29 |
| 合計ジャッジ時間 | 14,845 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 |
コンパイルメッセージ
warning: unused import: `std::collections::HashSet` --> src/main.rs:1:5 | 1 | use std::collections::HashSet; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
ソースコード
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);
}
pazzle1230