結果
| 問題 | No.2629 A replace B replace C |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-16 22:33:23 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 311 bytes |
| 記録 | |
| コンパイル時間 | 124 ms |
| コンパイル使用メモリ | 85,212 KB |
| 実行使用メモリ | 317,648 KB |
| 最終ジャッジ日時 | 2026-04-15 09:31:10 |
| 合計ジャッジ時間 | 6,906 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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))