結果

問題 No.2209 Flip and Reverse
ユーザー H20
提出日時 2023-02-10 22:35:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 267 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 82,852 KB
実行使用メモリ 248,964 KB
最終ジャッジ日時 2024-07-07 16:41:32
合計ジャッジ時間 7,220 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(input())
SR = S[::-1]
T = list(input())
scnt = sum([1 for s,t in zip(S,T) if s!=t])
srcnt = sum([1 for sr,t in zip(SR,T) if sr!=t])
if scnt%2==0 and srcnt%2==0:
    print(scnt)
elif scnt%2==0:
    print(min(scnt,srcnt))
elif srcnt%2==0:
    print(N)
else:
    print(srcnt)
0