結果

問題 No.2209 Flip and Reverse
ユーザー MasKoaTSMasKoaTS
提出日時 2023-02-10 21:38:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 81,792 KB
最終ジャッジ日時 2023-09-21 22:42:31
合計ジャッジ時間 7,087 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,248 KB
testcase_01 AC 74 ms
71,044 KB
testcase_02 AC 75 ms
70,912 KB
testcase_03 AC 75 ms
71,244 KB
testcase_04 AC 74 ms
71,224 KB
testcase_05 AC 74 ms
71,084 KB
testcase_06 AC 74 ms
71,080 KB
testcase_07 AC 75 ms
71,024 KB
testcase_08 WA -
testcase_09 AC 74 ms
71,008 KB
testcase_10 AC 74 ms
71,120 KB
testcase_11 AC 73 ms
71,160 KB
testcase_12 AC 74 ms
71,208 KB
testcase_13 WA -
testcase_14 AC 165 ms
81,348 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 164 ms
81,360 KB
testcase_19 AC 165 ms
81,100 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 163 ms
81,348 KB
testcase_24 AC 157 ms
81,488 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 141 ms
81,516 KB
testcase_29 AC 139 ms
81,440 KB
testcase_30 AC 141 ms
81,252 KB
testcase_31 WA -
testcase_32 AC 147 ms
81,280 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
t = input()

cnt = 0
for a, b in zip(s, t):
    cnt += (a != b)
ans = cnt + 2 * (cnt & 1)
cnt = 0
for a, b in zip(s[::-1], t):
    cnt += (a != b)
ans = min(ans, cnt + 2 - 2 * (cnt & 1))
print(ans)
0