結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
70,968 KB
testcase_01 AC 76 ms
71,176 KB
testcase_02 AC 75 ms
70,864 KB
testcase_03 AC 76 ms
71,052 KB
testcase_04 AC 77 ms
71,336 KB
testcase_05 AC 78 ms
71,296 KB
testcase_06 AC 77 ms
71,140 KB
testcase_07 AC 76 ms
71,180 KB
testcase_08 AC 115 ms
81,068 KB
testcase_09 AC 75 ms
70,996 KB
testcase_10 AC 76 ms
71,280 KB
testcase_11 AC 77 ms
71,164 KB
testcase_12 AC 75 ms
71,200 KB
testcase_13 AC 73 ms
71,296 KB
testcase_14 AC 131 ms
81,136 KB
testcase_15 AC 128 ms
81,264 KB
testcase_16 AC 130 ms
81,232 KB
testcase_17 AC 131 ms
81,280 KB
testcase_18 AC 131 ms
81,208 KB
testcase_19 AC 131 ms
81,372 KB
testcase_20 AC 130 ms
81,040 KB
testcase_21 AC 131 ms
81,276 KB
testcase_22 AC 132 ms
81,348 KB
testcase_23 AC 133 ms
81,476 KB
testcase_24 AC 128 ms
81,280 KB
testcase_25 AC 127 ms
81,152 KB
testcase_26 AC 126 ms
81,152 KB
testcase_27 AC 128 ms
81,136 KB
testcase_28 AC 116 ms
81,136 KB
testcase_29 AC 115 ms
81,164 KB
testcase_30 AC 115 ms
81,424 KB
testcase_31 AC 115 ms
81,416 KB
testcase_32 AC 114 ms
81,208 KB
testcase_33 AC 112 ms
81,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
S=input()
T=input()

ans=2**61-1

dif=0
for i in range(n):
    if S[i]!=T[i]:
        dif+=1

if dif%2==0:
    ans=dif

U=S[::-1]

dif=0
for i in range(n):
    if T[i]!=U[i]:
        dif+=1

if dif%2==1:
    ans=min(ans,dif)

print(ans)
0