結果

問題 No.2629 A replace B replace C
ユーザー timi
提出日時 2024-02-16 21:48:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 423 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,700 KB
実行使用メモリ 56,108 KB
最終ジャッジ日時 2024-09-28 20:02:38
合計ジャッジ時間 4,020 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 45 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

# 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=='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')
  
0