結果

問題 No.2209 Flip and Reverse
ユーザー katonyonkokatonyonko
提出日時 2023-02-10 21:28:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 86,632 KB
実行使用メモリ 94,612 KB
最終ジャッジ日時 2023-09-21 22:32:07
合計ジャッジ時間 5,350 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,200 KB
testcase_01 AC 70 ms
71,104 KB
testcase_02 AC 68 ms
71,080 KB
testcase_03 AC 67 ms
71,220 KB
testcase_04 AC 67 ms
71,080 KB
testcase_05 AC 74 ms
71,300 KB
testcase_06 AC 68 ms
71,224 KB
testcase_07 AC 69 ms
71,288 KB
testcase_08 AC 110 ms
94,396 KB
testcase_09 AC 69 ms
71,288 KB
testcase_10 AC 70 ms
71,080 KB
testcase_11 AC 69 ms
71,204 KB
testcase_12 AC 69 ms
71,224 KB
testcase_13 AC 69 ms
71,220 KB
testcase_14 AC 125 ms
94,296 KB
testcase_15 AC 130 ms
94,228 KB
testcase_16 AC 128 ms
94,516 KB
testcase_17 AC 127 ms
94,128 KB
testcase_18 AC 126 ms
94,296 KB
testcase_19 AC 128 ms
94,180 KB
testcase_20 AC 127 ms
94,296 KB
testcase_21 AC 126 ms
94,352 KB
testcase_22 AC 127 ms
94,444 KB
testcase_23 AC 128 ms
94,188 KB
testcase_24 AC 124 ms
94,416 KB
testcase_25 AC 125 ms
94,600 KB
testcase_26 AC 126 ms
94,612 KB
testcase_27 AC 125 ms
94,324 KB
testcase_28 AC 116 ms
94,292 KB
testcase_29 AC 117 ms
94,224 KB
testcase_30 AC 116 ms
94,272 KB
testcase_31 AC 115 ms
94,348 KB
testcase_32 AC 111 ms
94,480 KB
testcase_33 AC 111 ms
94,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def input():
  return sys.stdin.readline()[:-1]
N=int(input())
S=input()
T=input()
ans=10**10
tmp=sum([1 if S[i]!=T[i] else 0 for i in range(N)])
if tmp%2==0: ans=min(ans,tmp)
tmp=sum([1 if S[-i-1]!=T[i] else 0 for i in range(N)])
if tmp%2==1: ans=min(ans,tmp)
print(ans)
0