結果

問題 No.2209 Flip and Reverse
コンテスト
ユーザー coder_So_hey
提出日時 2023-02-10 21:42:38
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 345 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 342 ms
コンパイル使用メモリ 85,320 KB
実行使用メモリ 85,324 KB
最終ジャッジ日時 2026-03-29 07:11:03
合計ジャッジ時間 2,935 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
S = input()
T = input()

count1 = 0
for i in range(N):
    if S[i] != T[i]:
        count1 += 1

count2 = 0
for i in range(N):
    if S[N - i - 1] != T[i]:
        count2 += 1

if count1 % 2 == 0 and count2 % 2 == 1:
    print(min(count1, count2))
elif count1 % 2 == 0:
    print(count1)
elif count2 % 2 == 1:
    print(count2)
0