結果

問題 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  
実行時間 95 ms / 2,000 ms
+ 510µs
コード長 345 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 223 ms
コンパイル使用メモリ 95,720 KB
実行使用メモリ 88,832 KB
最終ジャッジ日時 2026-08-11 11:19:30
合計ジャッジ時間 5,461 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_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