結果

問題 No.2209 Flip and Reverse
ユーザー rlangevinrlangevin
提出日時 2023-02-10 21:53:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 239 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 1,413 ms
コンパイル使用メモリ 86,584 KB
実行使用メモリ 173,644 KB
最終ジャッジ日時 2023-09-21 23:04:07
合計ジャッジ時間 8,438 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,960 KB
testcase_01 AC 70 ms
70,960 KB
testcase_02 AC 71 ms
71,136 KB
testcase_03 AC 71 ms
71,456 KB
testcase_04 AC 70 ms
71,308 KB
testcase_05 AC 72 ms
71,216 KB
testcase_06 AC 72 ms
71,108 KB
testcase_07 AC 71 ms
71,352 KB
testcase_08 AC 214 ms
173,092 KB
testcase_09 AC 85 ms
70,996 KB
testcase_10 AC 72 ms
71,440 KB
testcase_11 AC 72 ms
70,996 KB
testcase_12 AC 75 ms
71,404 KB
testcase_13 AC 72 ms
71,140 KB
testcase_14 AC 226 ms
173,456 KB
testcase_15 AC 227 ms
173,468 KB
testcase_16 AC 234 ms
173,468 KB
testcase_17 AC 225 ms
173,644 KB
testcase_18 AC 228 ms
173,500 KB
testcase_19 AC 223 ms
173,452 KB
testcase_20 AC 224 ms
173,512 KB
testcase_21 AC 239 ms
173,508 KB
testcase_22 AC 227 ms
173,452 KB
testcase_23 AC 223 ms
173,480 KB
testcase_24 AC 215 ms
173,184 KB
testcase_25 AC 218 ms
173,420 KB
testcase_26 AC 219 ms
173,504 KB
testcase_27 AC 219 ms
173,188 KB
testcase_28 AC 202 ms
173,124 KB
testcase_29 AC 206 ms
173,372 KB
testcase_30 AC 210 ms
173,380 KB
testcase_31 AC 206 ms
173,436 KB
testcase_32 AC 203 ms
173,376 KB
testcase_33 AC 202 ms
173,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(input())
T = list(input())
Sr = S[::-1]
cnt1, cnt2 = 0, 0
for i in range(N):
    if S[i] != T[i]:
        cnt1 += 1
    if Sr[i] != T[i]:
        cnt2 += 1
inf = 10 ** 18
if cnt1 % 2:
    cnt1 += inf
if cnt2 % 2 == 0:
    cnt2 += inf
print( min(cnt1, cnt2) )
0