結果

問題 No.2209 Flip and Reverse
ユーザー YutaYuta
提出日時 2023-03-16 10:42:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 386 ms
コンパイル使用メモリ 11,740 KB
実行使用メモリ 10,056 KB
最終ジャッジ日時 2023-10-18 12:56:31
合計ジャッジ時間 6,468 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 29 ms
10,040 KB
testcase_03 AC 28 ms
10,040 KB
testcase_04 AC 28 ms
10,040 KB
testcase_05 AC 29 ms
10,040 KB
testcase_06 AC 28 ms
10,040 KB
testcase_07 AC 29 ms
10,040 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
t = input()

#SとTの一致しない文字数を数える
def count(s, t):
    counter = 0
    for i in range(len(s)):
        if  s[i] != t[i]:
            counter += 1
    return counter

#Sを反転した後のTとの違い
def count2(s, t):
    counter2 = 0
    for j in range(len(s)):
        s = s[::-1]
        if s[j] != t[j]:
            counter2 += 1
    return counter2

def count3(s, t):
    counter3 = 0
    for q in range(len(s)):
        s = s[0] + s[1:][::-1]
        if s[q] != t[q]:
            counter3 += 1
    return counter3

print(min(count(s,t), count2(s, t), count3(s, t)))
0