結果

問題 No.2209 Flip and Reverse
ユーザー 👑 H20H20
提出日時 2023-02-10 22:35:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 301 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 248,700 KB
最終ジャッジ日時 2023-09-21 23:46:02
合計ジャッジ時間 9,047 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,460 KB
testcase_01 AC 72 ms
71,480 KB
testcase_02 AC 71 ms
71,404 KB
testcase_03 AC 70 ms
71,584 KB
testcase_04 AC 72 ms
71,428 KB
testcase_05 AC 73 ms
71,596 KB
testcase_06 AC 72 ms
71,372 KB
testcase_07 AC 71 ms
71,144 KB
testcase_08 AC 292 ms
248,032 KB
testcase_09 AC 71 ms
71,504 KB
testcase_10 AC 71 ms
71,564 KB
testcase_11 AC 74 ms
71,396 KB
testcase_12 AC 74 ms
71,428 KB
testcase_13 AC 75 ms
71,376 KB
testcase_14 AC 301 ms
246,204 KB
testcase_15 AC 300 ms
246,312 KB
testcase_16 AC 293 ms
246,104 KB
testcase_17 AC 292 ms
246,180 KB
testcase_18 AC 290 ms
246,248 KB
testcase_19 AC 290 ms
246,424 KB
testcase_20 AC 298 ms
246,028 KB
testcase_21 AC 287 ms
246,316 KB
testcase_22 AC 289 ms
246,180 KB
testcase_23 AC 293 ms
246,220 KB
testcase_24 AC 284 ms
247,908 KB
testcase_25 AC 279 ms
247,784 KB
testcase_26 AC 278 ms
247,928 KB
testcase_27 AC 280 ms
248,004 KB
testcase_28 AC 259 ms
248,512 KB
testcase_29 AC 258 ms
248,700 KB
testcase_30 AC 256 ms
248,472 KB
testcase_31 AC 268 ms
248,340 KB
testcase_32 AC 261 ms
247,920 KB
testcase_33 AC 253 ms
248,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(input())
SR = S[::-1]
T = list(input())
scnt = sum([1 for s,t in zip(S,T) if s!=t])
srcnt = sum([1 for sr,t in zip(SR,T) if sr!=t])
if scnt%2==0 and srcnt%2==0:
    print(scnt)
elif scnt%2==0:
    print(min(scnt,srcnt))
elif srcnt%2==0:
    print(N)
else:
    print(srcnt)
0