提出 #5183398
ソースコード 拡げる
fn read<T: ::std::str::FromStr>() -> T {
let mut s = String::new();
::std::io::stdin().read_line(&mut s).ok();
s.trim().parse().ok().unwrap()
}
fn read_vec<T: ::std::str::FromStr>() -> Vec<T> {
let mut s = String::new();
::std::io::stdin().read_line(&mut s).ok();
s.trim().split_whitespace()
.map(|e| e.parse().ok().unwrap()).collect()
}
pub fn main() {
let ABC = read_vec();
let A: i32 = ABC[0];
let B: i32 = ABC[1];
let C: i32 = ABC[2];
if (A <= C && B >= C) || (A >= C && B <= C) {
println!("Yes");
} else {
println!("No");
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - On the Way |
| ユーザ | gdmiwasawa |
| 言語 | Rust (1.15.1) |
| 得点 | 100 |
| コード長 | 631 Byte |
| 結果 | AC |
| 実行時間 | 2 ms |
| メモリ | 4352 KiB |
コンパイルエラー
warning: function is never used: `read`, #[warn(dead_code)] on by default
--> ./Main.rs:1:1
|
1 | fn read<T: ::std::str::FromStr>() -> T {
| _^ starting here...
2 | | let mut s = String::new();
3 | | ::std::io::stdin().read_line(&mut s).ok();
4 | | s.trim().parse().ok().unwrap()
5 | | }
| |_^ ...ending here
warning: variable `ABC` should have a snake case name such as `abc`, #[warn(non_snake_case)] on by default
--> ./Main.rs:15:9
|
15 | let ABC = read_vec();
| ^^^
warning: variable `A` should have a snake case name such as `a`, #[warn(non_snake_case)] on by default
--> ./Main.rs:16:9
|
16 | let A: i32 = ABC[0];
| ^
warning: variable `B` should have a snake case name such as `b`, #[warn(non_snake_case)] on by default
--> ./Main.rs:17:9
|
17 | let B: i32 = ABC[1];
| ^
warning: variable `C` should have a snake case name such as `c`, #[warn(non_snake_case)] on by default
--> ./Main.rs:18:9
|
18 | let C: i32 = A...
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | s1.txt, s2.txt, s3.txt, s4.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, s1.txt, s2.txt, s3.txt, s4.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | AC | 2 ms | 4352 KiB |
| 02.txt | AC | 2 ms | 4352 KiB |
| 03.txt | AC | 2 ms | 4352 KiB |
| 04.txt | AC | 2 ms | 4352 KiB |
| 05.txt | AC | 2 ms | 4352 KiB |
| 06.txt | AC | 2 ms | 4352 KiB |
| s1.txt | AC | 2 ms | 4352 KiB |
| s2.txt | AC | 2 ms | 4352 KiB |
| s3.txt | AC | 2 ms | 4352 KiB |
| s4.txt | AC | 2 ms | 4352 KiB |