結果
| 問題 |
No.1366 交換門松列・梅
|
| コンテスト | |
| ユーザー |
BrightLight
|
| 提出日時 | 2021-01-29 21:41:19 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,111 bytes |
| コンパイル時間 | 13,395 ms |
| コンパイル使用メモリ | 402,196 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-03 06:14:15 |
| 合計ジャッジ時間 | 14,284 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 2 |
ソースコード
fn main() {
let a: Vec<usize> = read_vec();
let b: Vec<usize> = read_vec();
let mut ans: String = "No".to_string();
for i in 0..3 {
for j in 0..3 {
let mut ac = a.clone();
let mut bc = b.clone();
let ai = a[i];
let bj = b[j];
ac[i] = bj;
bc[j] = ai;
if ac[0] != ac[1] && ac[0] != ac[2] && ac[1] != ac[2]
&& bc[0] != bc[1] && bc[0] != bc[2] && bc[1] != bc[2] {
if (ac[0] < ac[1] && ac[2] < ac[1]) || (ac[0] > ac[1] && ac[2] > ac[1])
&& (bc[0] < bc[1] && bc[2] < bc[1]) || (bc[0] > bc[1] && bc[2] > bc[1]) {
ans = "Yes".to_string();
}
}
}
}
println!("{}", ans);
}
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> {
read::<String>().split_whitespace()
.map(|e| e.parse().ok().unwrap()).collect()
}
BrightLight