結果

問題 No.2209 Flip and Reverse
ユーザー flygonflygon
提出日時 2023-02-10 21:26:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 81,420 KB
最終ジャッジ日時 2023-09-21 22:27:43
合計ジャッジ時間 5,688 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,136 KB
testcase_01 AC 73 ms
71,396 KB
testcase_02 AC 74 ms
71,128 KB
testcase_03 AC 75 ms
70,928 KB
testcase_04 AC 73 ms
71,168 KB
testcase_05 AC 75 ms
71,200 KB
testcase_06 AC 73 ms
71,296 KB
testcase_07 AC 72 ms
71,196 KB
testcase_08 AC 112 ms
80,972 KB
testcase_09 AC 73 ms
71,120 KB
testcase_10 AC 74 ms
70,860 KB
testcase_11 AC 72 ms
71,044 KB
testcase_12 AC 71 ms
71,180 KB
testcase_13 AC 70 ms
71,124 KB
testcase_14 AC 128 ms
81,236 KB
testcase_15 AC 131 ms
81,272 KB
testcase_16 AC 131 ms
81,316 KB
testcase_17 AC 130 ms
81,240 KB
testcase_18 AC 131 ms
81,344 KB
testcase_19 AC 132 ms
81,368 KB
testcase_20 AC 131 ms
81,280 KB
testcase_21 AC 131 ms
81,296 KB
testcase_22 AC 131 ms
81,372 KB
testcase_23 AC 130 ms
81,380 KB
testcase_24 AC 124 ms
81,420 KB
testcase_25 AC 124 ms
81,364 KB
testcase_26 AC 124 ms
81,232 KB
testcase_27 AC 129 ms
81,276 KB
testcase_28 AC 116 ms
81,040 KB
testcase_29 AC 112 ms
81,420 KB
testcase_30 AC 113 ms
81,300 KB
testcase_31 AC 111 ms
81,416 KB
testcase_32 AC 112 ms
81,100 KB
testcase_33 AC 111 ms
81,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
t = input()
ans = 0
for i in range(n):
  if s[i] != t[i]:
    ans += 1

if ans % 2 == 1:
  ans = 10**18
ans2 = 0
s = s[::-1]
for i in range(n):
  if s[i] != t[i]:
    ans2 += 1
if ans2 % 2 == 0:
  ans2 = 10**18

print(min(ans,ans2))
0