結果
| 問題 | No.2629 A replace B replace C |
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2024-02-16 21:49:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 2,000 ms |
| コード長 | 452 bytes |
| 記録 | |
| コンパイル時間 | 364 ms |
| コンパイル使用メモリ | 85,040 KB |
| 実行使用メモリ | 78,868 KB |
| 最終ジャッジ日時 | 2026-04-15 08:52:23 |
| 合計ジャッジ時間 | 4,478 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 61 |
ソースコード
# T=int(input())
# for _ in range(T):
# x1,y1,x2,y2,X1,Y1,X2,Y2=map(int,input().split())
N=int(input())
S=input()
T=input()
if S==T:
print('Yes')
exit()
x,y,z=0,0,0
for i in range(N):
s,t=S[i],T[i]
if s!=t:
if s=='A' and t=='B':
x+=1
elif s=='A' and t=='C':
y+=1
elif s=='B' and t=='C':
z+=1
else:
print('No')
exit()
if x!=z:
print('No')
exit()
if z>0:
print('Yes')
else:
print('No')
timi