結果

問題 No.2209 Flip and Reverse
ユーザー タコイモタコイモ
提出日時 2023-02-10 21:27:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 256 ms / 2,000 ms
コード長 827 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 174,564 KB
最終ジャッジ日時 2023-09-21 22:29:21
合計ジャッジ時間 8,487 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,376 KB
testcase_01 AC 92 ms
71,696 KB
testcase_02 AC 92 ms
71,556 KB
testcase_03 AC 92 ms
71,604 KB
testcase_04 AC 93 ms
71,728 KB
testcase_05 AC 92 ms
71,700 KB
testcase_06 AC 91 ms
71,544 KB
testcase_07 AC 94 ms
71,696 KB
testcase_08 AC 243 ms
174,248 KB
testcase_09 AC 93 ms
71,736 KB
testcase_10 AC 92 ms
71,380 KB
testcase_11 AC 91 ms
71,376 KB
testcase_12 AC 92 ms
71,732 KB
testcase_13 AC 90 ms
71,740 KB
testcase_14 AC 254 ms
174,272 KB
testcase_15 AC 255 ms
174,096 KB
testcase_16 AC 252 ms
174,188 KB
testcase_17 AC 256 ms
174,264 KB
testcase_18 AC 253 ms
174,260 KB
testcase_19 AC 254 ms
174,504 KB
testcase_20 AC 253 ms
174,260 KB
testcase_21 AC 255 ms
174,396 KB
testcase_22 AC 255 ms
174,296 KB
testcase_23 AC 255 ms
174,388 KB
testcase_24 AC 248 ms
174,252 KB
testcase_25 AC 249 ms
174,564 KB
testcase_26 AC 247 ms
174,472 KB
testcase_27 AC 248 ms
174,260 KB
testcase_28 AC 232 ms
174,104 KB
testcase_29 AC 235 ms
174,284 KB
testcase_30 AC 232 ms
174,268 KB
testcase_31 AC 232 ms
174,292 KB
testcase_32 AC 228 ms
174,096 KB
testcase_33 AC 230 ms
174,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import time
import sys
#sys.setrecursionlimit(500000)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def TI(): return tuple(map(int,sys.stdin.readline().rstrip().split()))
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip())
#for i, pi in enumerate(p):
from collections import defaultdict,deque
import bisect
import itertools
dic = defaultdict(int)
d = deque()
N = I()
S = LS()
T = LS()
ans = 0
ans1 = 0
for i in range(N):
  if S[i] != T[i]:
    ans += 1
S.reverse()
for i in range(N):
  if S[i] != T[i]:
    ans1 += 1
answer = float('inf')
if ans % 2 == 0:
  answer = min(ans,answer)
if ans % 2 == 1:
  answer = min(ans1,answer)
print(answer)
0