結果

問題 No.2209 Flip and Reverse
コンテスト
ユーザー koheijkt
提出日時 2026-01-29 21:35:05
言語 PyPy3
(7.3.17)
結果
WA  
実行時間 -
コード長 349 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 363 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 79,856 KB
最終ジャッジ日時 2026-01-29 21:35:13
合計ジャッジ時間 5,491 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 18 WA * 12
権限があれば一括ダウンロードができます

ソースコード

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