結果

問題 No.2871 Universal Serial Bus
ユーザー well-definedwell-defined
提出日時 2024-09-14 12:04:26
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 840 bytes
コンパイル時間 14,790 ms
コンパイル使用メモリ 379,048 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 12:04:43
合計ジャッジ時間 15,678 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
        },
    }
}
0