結果

問題 No.2209 Flip and Reverse
ユーザー lloyzlloyz
提出日時 2023-02-10 21:56:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 433 bytes
コンパイル時間 1,291 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 166,204 KB
最終ジャッジ日時 2023-09-21 23:09:25
合計ジャッジ時間 7,717 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,180 KB
testcase_01 AC 72 ms
71,380 KB
testcase_02 AC 71 ms
71,192 KB
testcase_03 AC 72 ms
71,000 KB
testcase_04 AC 72 ms
71,184 KB
testcase_05 AC 71 ms
71,164 KB
testcase_06 AC 71 ms
71,252 KB
testcase_07 AC 70 ms
70,956 KB
testcase_08 WA -
testcase_09 AC 70 ms
71,308 KB
testcase_10 AC 70 ms
71,140 KB
testcase_11 WA -
testcase_12 AC 70 ms
71,240 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 180 ms
165,616 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = list(input())
T = list(input())

ans = 0
flip = 0
for i in range(n // 2):
    if S[i] != T[n - i - 1] and S[n - i - 1] != T[i]:
        if S[i] == S[n - i - 1]:
            ans += 2
        else:
            flip += 1
    elif S[i] != T[n - i - 1] or S[n - i - 1] != T[i]:
        ans += 1
if n % 2 == 1:
    if S[n // 2] != T[n // 2]:
        ans += 1
if ans % 2 == 0 and flip % 2 == 1:
    ans += 2
print(ans)
0