結果
問題 |
No.2629 A replace B replace C
|
ユーザー |
|
提出日時 | 2024-02-16 22:33:23 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 311 bytes |
コンパイル時間 | 299 ms |
コンパイル使用メモリ | 82,404 KB |
実行使用メモリ | 273,736 KB |
最終ジャッジ日時 | 2024-09-28 21:08:59 |
合計ジャッジ時間 | 6,918 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 5 |
other | TLE * 1 -- * 60 |
ソースコード
def can_transform(S, T): for i in range(len(S)): if S[i] > T[i] or (S[i] == 'A' and T[i] == 'C'): return "No" S = S[:i] + S[i:].replace(S[i], T[i]) return "Yes" if S == T else "No" N = int(input().strip()) S = input().strip() T = input().strip() print(can_transform(S, T))