結果
| 問題 |
No.2629 A replace B replace C
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-18 17:37:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 258 bytes |
| コンパイル時間 | 218 ms |
| コンパイル使用メモリ | 82,384 KB |
| 実行使用メモリ | 75,968 KB |
| 最終ジャッジ日時 | 2024-09-29 00:43:44 |
| 合計ジャッジ時間 | 5,270 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 WA * 1 |
| other | AC * 45 WA * 16 |
ソースコード
n = int(input())
S = input()
T = input()
f = False
ab = 0
bc = 0
for s, t in zip(S, T):
if s == "A" and t == "B":
ab += 1
elif s == "B" and t == "C":
bc += 1
f = True
if f and ab == bc:
print("Yes")
else:
print("No")