結果
| 問題 |
No.2871 Universal Serial Bus
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-23 11:55:20 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 548 bytes |
| コンパイル時間 | 12,994 ms |
| コンパイル使用メモリ | 406,004 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-23 11:55:36 |
| 合計ジャッジ時間 | 14,760 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 WA * 7 |
ソースコード
use proconio::{input, marker::Chars};
fn main() {
input! {
h:usize,
w:usize,
s:[Chars;h],
t:[Chars;h],
}
let mut s_rev = vec![vec!['.'; w]; h];
for i in 0..h {
for j in 0..w {
s_rev[i][j] = s[h - i - 1][j];
}
}
let ans = if (0..h).all(|i| (0..w).all(|j| s[i][j] != t[i][j])) {
3.531740190461733
} else if (0..h).all(|i| (0..w).all(|j| s_rev[i][j] != t[i][j])) {
3.128936827211877
} else {
-1.0
};
println!("{}", ans);
}