結果

問題 No.2209 Flip and Reverse
ユーザー MasKoaTS
提出日時 2023-02-10 21:38:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 80,980 KB
最終ジャッジ日時 2024-07-07 15:48:53
合計ジャッジ時間 4,496 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
t = input()

cnt = 0
for a, b in zip(s, t):
    cnt += (a != b)
ans = cnt + 2 * (cnt & 1)
cnt = 0
for a, b in zip(s[::-1], t):
    cnt += (a != b)
ans = min(ans, cnt + 2 - 2 * (cnt & 1))
print(ans)
0