結果

問題 No.2209 Flip and Reverse
ユーザー tamatotamato
提出日時 2023-02-10 21:27:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 472 bytes
コンパイル時間 1,172 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 81,200 KB
最終ジャッジ日時 2023-09-21 22:30:40
合計ジャッジ時間 5,622 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,188 KB
testcase_01 AC 71 ms
70,776 KB
testcase_02 AC 70 ms
70,916 KB
testcase_03 AC 70 ms
70,964 KB
testcase_04 AC 71 ms
71,000 KB
testcase_05 AC 69 ms
71,016 KB
testcase_06 AC 69 ms
71,192 KB
testcase_07 AC 72 ms
71,104 KB
testcase_08 AC 120 ms
80,752 KB
testcase_09 AC 69 ms
71,252 KB
testcase_10 AC 70 ms
71,104 KB
testcase_11 AC 69 ms
71,104 KB
testcase_12 AC 70 ms
70,964 KB
testcase_13 AC 71 ms
70,816 KB
testcase_14 AC 146 ms
80,852 KB
testcase_15 AC 146 ms
81,148 KB
testcase_16 AC 143 ms
80,644 KB
testcase_17 AC 145 ms
80,672 KB
testcase_18 AC 145 ms
80,940 KB
testcase_19 AC 146 ms
81,200 KB
testcase_20 AC 143 ms
81,084 KB
testcase_21 AC 146 ms
80,836 KB
testcase_22 AC 143 ms
80,668 KB
testcase_23 AC 144 ms
80,808 KB
testcase_24 AC 136 ms
80,804 KB
testcase_25 AC 138 ms
80,872 KB
testcase_26 AC 135 ms
80,760 KB
testcase_27 AC 135 ms
80,804 KB
testcase_28 AC 119 ms
80,820 KB
testcase_29 AC 120 ms
80,964 KB
testcase_30 AC 122 ms
80,800 KB
testcase_31 AC 122 ms
81,144 KB
testcase_32 AC 120 ms
80,556 KB
testcase_33 AC 119 ms
80,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    S = input().rstrip('\n')
    T = input().rstrip('\n')

    ans = 0
    for s, t in zip(S, T):
        if s != t:
            ans += 1
    if ans & 1:
        ans = 10 ** 9
    ans2 = 0
    for s, t in zip(S, T[::-1]):
        if s != t:
            ans2 += 1
    if ans2 & 1 == 0:
        ans2 = 10 ** 9
    print(min(ans, ans2))


if __name__ == '__main__':
    main()
0