結果

問題 No.2209 Flip and Reverse
ユーザー Ekiben542Ekiben542
提出日時 2024-03-09 23:34:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 414 bytes
コンパイル時間 2,239 ms
コンパイル使用メモリ 81,444 KB
実行使用メモリ 171,048 KB
最終ジャッジ日時 2024-03-09 23:35:08
合計ジャッジ時間 7,089 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def min_operations(N, S, T):
    S = list(S)
    T = list(T)
    operations = 0
    flip = 0

    for i in range(N-1, -1, -1):
        if (S[i] == T[i] and flip % 2 == 0) or (S[i] != T[i] and flip % 2 == 1):
            continue
        else:
            flip += 1
            operations += 1

    return operations


N = int(input().strip())
S = input().strip()
T = input().strip()

print(min_operations(N, S, T))
0