結果

問題 No.2209 Flip and Reverse
ユーザー flygon
提出日時 2023-02-10 21:26:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 80,640 KB
最終ジャッジ日時 2024-07-07 15:35:14
合計ジャッジ時間 4,304 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
t = input()
ans = 0
for i in range(n):
  if s[i] != t[i]:
    ans += 1

if ans % 2 == 1:
  ans = 10**18
ans2 = 0
s = s[::-1]
for i in range(n):
  if s[i] != t[i]:
    ans2 += 1
if ans2 % 2 == 0:
  ans2 = 10**18

print(min(ans,ans2))
0