結果
| 問題 |
No.2209 Flip and Reverse
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-09 23:34:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 414 bytes |
| コンパイル時間 | 330 ms |
| コンパイル使用メモリ | 82,060 KB |
| 実行使用メモリ | 171,864 KB |
| 最終ジャッジ日時 | 2024-09-29 21:23:41 |
| 合計ジャッジ時間 | 7,290 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 WA * 23 |
ソースコード
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))