結果

問題 No.2209 Flip and Reverse
ユーザー 👑 KazunKazun
提出日時 2023-02-10 21:25:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 81,000 KB
最終ジャッジ日時 2023-09-21 22:26:55
合計ジャッジ時間 5,617 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,132 KB
testcase_01 AC 73 ms
71,180 KB
testcase_02 AC 74 ms
71,124 KB
testcase_03 AC 73 ms
71,284 KB
testcase_04 AC 73 ms
71,212 KB
testcase_05 AC 74 ms
71,192 KB
testcase_06 AC 75 ms
71,260 KB
testcase_07 AC 75 ms
70,972 KB
testcase_08 AC 108 ms
80,600 KB
testcase_09 AC 74 ms
71,284 KB
testcase_10 AC 75 ms
71,208 KB
testcase_11 AC 75 ms
70,968 KB
testcase_12 AC 76 ms
71,204 KB
testcase_13 AC 76 ms
71,120 KB
testcase_14 AC 128 ms
80,956 KB
testcase_15 AC 132 ms
80,940 KB
testcase_16 AC 128 ms
80,708 KB
testcase_17 AC 130 ms
80,880 KB
testcase_18 AC 131 ms
80,992 KB
testcase_19 AC 129 ms
80,660 KB
testcase_20 AC 128 ms
80,844 KB
testcase_21 AC 133 ms
80,852 KB
testcase_22 AC 137 ms
80,868 KB
testcase_23 AC 133 ms
80,740 KB
testcase_24 AC 126 ms
81,000 KB
testcase_25 AC 126 ms
80,656 KB
testcase_26 AC 125 ms
80,728 KB
testcase_27 AC 123 ms
80,848 KB
testcase_28 AC 112 ms
80,952 KB
testcase_29 AC 111 ms
80,656 KB
testcase_30 AC 110 ms
80,904 KB
testcase_31 AC 111 ms
80,896 KB
testcase_32 AC 108 ms
80,580 KB
testcase_33 AC 110 ms
80,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N=int(input())
    S=input()
    T=input()

    # even
    X=0
    for i in range(N):
        if S[i]!=T[i]:
            X+=1

    if X%2!=0:
        X=10**10

    # odd
    Y=0
    for i in range(N):
        if S[~i]!=T[i]:
            Y+=1

    if Y%2!=1:
        Y=10**10
    return min(X,Y)

#==================================================
print(solve())
0