結果

問題 No.2209 Flip and Reverse
ユーザー deepjugglingdeepjuggling
提出日時 2023-02-10 22:35:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 233 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 173,672 KB
最終ジャッジ日時 2023-09-21 23:45:41
合計ジャッジ時間 7,526 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,420 KB
testcase_01 AC 72 ms
71,620 KB
testcase_02 AC 71 ms
71,088 KB
testcase_03 AC 72 ms
71,332 KB
testcase_04 AC 77 ms
71,112 KB
testcase_05 AC 74 ms
71,264 KB
testcase_06 AC 72 ms
71,168 KB
testcase_07 AC 72 ms
71,108 KB
testcase_08 AC 198 ms
173,516 KB
testcase_09 AC 76 ms
71,388 KB
testcase_10 AC 73 ms
71,260 KB
testcase_11 AC 72 ms
71,288 KB
testcase_12 AC 70 ms
71,568 KB
testcase_13 AC 72 ms
71,436 KB
testcase_14 AC 218 ms
173,400 KB
testcase_15 AC 220 ms
173,628 KB
testcase_16 AC 222 ms
173,628 KB
testcase_17 AC 222 ms
173,608 KB
testcase_18 AC 221 ms
173,640 KB
testcase_19 AC 221 ms
173,608 KB
testcase_20 AC 223 ms
173,308 KB
testcase_21 AC 219 ms
173,524 KB
testcase_22 AC 218 ms
173,640 KB
testcase_23 AC 220 ms
173,672 KB
testcase_24 AC 233 ms
173,632 KB
testcase_25 AC 213 ms
173,632 KB
testcase_26 AC 213 ms
173,592 KB
testcase_27 AC 215 ms
173,612 KB
testcase_28 AC 204 ms
173,476 KB
testcase_29 AC 197 ms
173,600 KB
testcase_30 AC 199 ms
173,424 KB
testcase_31 AC 198 ms
173,536 KB
testcase_32 AC 197 ms
173,668 KB
testcase_33 AC 194 ms
173,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
t = input()
s = list(s)
t = list(t)
ss = list(s)
ss.reverse()
mae = 0
usi = 0
for i in range(n):
    if s[i] != t[i]:
        mae += 1
    if ss[i] != t[i]:
        usi += 1
if mae <= usi and mae % 2 == 0:
    print(mae)
elif usi <= mae and usi % 2 == 1:
    print(usi)
elif mae % 2 == 0:
    print(mae)
else:
    print(usi)
0