結果

問題 No.2209 Flip and Reverse
ユーザー tamatotamato
提出日時 2023-02-10 21:26:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 498 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 81,612 KB
最終ジャッジ日時 2023-09-21 22:27:51
合計ジャッジ時間 5,809 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,200 KB
testcase_01 AC 69 ms
71,368 KB
testcase_02 AC 68 ms
71,272 KB
testcase_03 AC 68 ms
71,512 KB
testcase_04 AC 67 ms
71,508 KB
testcase_05 AC 68 ms
71,560 KB
testcase_06 AC 68 ms
71,284 KB
testcase_07 AC 68 ms
71,204 KB
testcase_08 WA -
testcase_09 AC 69 ms
71,444 KB
testcase_10 AC 70 ms
71,308 KB
testcase_11 AC 68 ms
71,544 KB
testcase_12 AC 68 ms
71,472 KB
testcase_13 WA -
testcase_14 AC 143 ms
81,208 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 142 ms
80,936 KB
testcase_19 AC 145 ms
81,432 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 142 ms
81,052 KB
testcase_24 AC 136 ms
81,308 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 121 ms
81,188 KB
testcase_29 AC 121 ms
81,092 KB
testcase_30 AC 122 ms
81,232 KB
testcase_31 WA -
testcase_32 AC 120 ms
81,012 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

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 += 1
    ans2 = 0
    for s, t in zip(S, T[::-1]):
        if s != t:
            ans2 += 1
    if ans2 == 0:
        ans2 += 1
    if ans2 & 1 == 0:
        ans2 += 1
    print(min(ans, ans2))


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