結果

問題 No.2209 Flip and Reverse
ユーザー rlangevinrlangevin
提出日時 2023-02-10 21:53:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 194 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 82,056 KB
実行使用メモリ 174,616 KB
最終ジャッジ日時 2024-07-07 16:07:36
合計ジャッジ時間 5,621 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

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