結果
| 問題 |
No.2629 A replace B replace C
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2024-02-17 13:34:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 383 bytes |
| コンパイル時間 | 180 ms |
| コンパイル使用メモリ | 82,564 KB |
| 実行使用メモリ | 76,956 KB |
| 最終ジャッジ日時 | 2024-09-28 23:40:56 |
| 合計ジャッジ時間 | 4,957 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 51 WA * 10 |
ソースコード
N = int(input())
S = input()
T = input()
if S == T:
print("Yes")
exit()
from collections import defaultdict
dic = defaultdict(int)
for i in range(N):
if S[i] > T[i]:
print("No")
exit()
elif S[i] < T[i]:
dic[(S[i],T[i])] += 1
if dic[('A','B')] == 0:
print("No")
exit()
if dic[('A','B')] != dic[('B','C')]:
print("No")
print("Yes")
ntuda