結果

問題 No.2209 Flip and Reverse
コンテスト
ユーザー koheijkt
提出日時 2026-01-29 21:42:34
言語 PyPy3
(7.3.17)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 350 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 303 ms
コンパイル使用メモリ 82,556 KB
実行使用メモリ 80,968 KB
最終ジャッジ日時 2026-01-29 21:42:39
合計ジャッジ時間 4,618 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
sys.set_int_max_str_digits(0)
#input = sys.stdin.readline

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

# 偶数?
cnt = 0
for i in range(N):
    s, t = S[i], T[i]
    if s != t:
        cnt += 1

if cnt%2 == 0:
    exit(print(cnt))

S2 = S[::-1]
cnt = 0
for i in range(N):
    s, t = S2[i], T[i]
    if s != t:
        cnt += 1

print(cnt)


0