結果
| 問題 |
No.8033 Test of Russian
|
| コンテスト | |
| ユーザー |
lzy9
|
| 提出日時 | 2018-04-01 22:20:28 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 574 bytes |
| コンパイル時間 | 13,997 ms |
| コンパイル使用メモリ | 376,780 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 05:51:13 |
| 合計ジャッジ時間 | 14,086 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 |
コンパイルメッセージ
warning: unused imports: `max`, `min`
--> src/main.rs:3:16
|
3 | use std::cmp::{min, max};
| ^^^ ^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: variable `N` should have a snake case name
--> src/main.rs:18:9
|
18 | let N = read::<i32>();
| ^ help: convert the identifier to snake case: `n`
|
= note: `#[warn(non_snake_case)]` on by default
warning: variable `M` should have a snake case name
--> src/main.rs:19:9
|
19 | let M = read::<i32>();
| ^ help: convert the identifier to snake case: `m`
warning: variable `X` should have a snake case name
--> src/main.rs:20:9
|
20 | let X = read::<i32>();
| ^ help: convert the identifier to snake case (notice the capitalization): `x`
ソースコード
use std::io::*;
use std::str::FromStr;
use std::cmp::{min, max};
fn read<T: FromStr>() -> T {
let stdin = stdin();
let stdin_lock = stdin.lock();
let s = stdin_lock
.bytes()
.map(|c| c.unwrap() as char)
.skip_while(|c| c.is_whitespace())
.take_while(|c| !c.is_whitespace())
.collect::<String>();
s.parse::<T>().ok().unwrap()
}
fn main() {
let N = read::<i32>();
let M = read::<i32>();
let X = read::<i32>();
if 3 <= X - (N - M) {
println!("YES");
} else {
println!("NO");
}
}
lzy9