結果
| 問題 |
No.2871 Universal Serial Bus
|
| コンテスト | |
| ユーザー |
well-defined
|
| 提出日時 | 2024-09-14 12:04:26 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 840 bytes |
| コンパイル時間 | 14,790 ms |
| コンパイル使用メモリ | 379,048 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 12:04:43 |
| 合計ジャッジ時間 | 15,678 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 15 WA * 3 |
ソースコード
use proconio::input;
use proconio::marker::Chars;
fn main () {
input! {
h: usize,
_: usize,
s: [Chars; h],
t: [Chars; h],
}
let s_rev = s.iter()
.rev()
.cloned()
.collect::<Vec<_>>();
let t = t.iter()
.map(|v| {
v.iter().map(|&c| if c == '.' {'#'} else {'.'}).collect::<Vec<_>>()
})
.collect::<Vec<_>>();
match (s, s_rev, t) {
(s, s_rev, t)
if (s == t) & (s_rev == t) => {
println!("{}", 2.641632560655154);
},
(s, _, t)
if s == t => {
println!("{}", 3.531740190461733);
},
(_, s_rev, t)
if s_rev == t => {
println!("{}", 3.128936827211877);
},
(_, _, _) => {
println!("{}", -1);
},
}
}
well-defined