結果

問題 No.2629 A replace B replace C
ユーザー tassei903tassei903
提出日時 2024-02-11 13:53:23
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 757 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 82,496 KB
実行使用メモリ 54,924 KB
最終ジャッジ日時 2024-09-28 18:16:54
合計ジャッジ時間 5,807 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 2
other AC * 17 WA * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
######################################################################

s = input()
t = input()

x1, x2, x3 = 0,0,0

for i in range(len(s)):
    if s[i] == t[i]:
        continue
    elif s[i] > t[i]:
        No()
        exit()
    elif s[i] == "A" and t[i] == "B":
        x1 += 1
    elif s[i] == "A" and t[i] == "C":
        x2 += 1
    elif s[i] == "B" and t[i] == "C":
        x3 += 1

if x1 == x2 == x3 == 0:
    Yes()
elif x1 == x3 and x1 > 0:
    Yes()
else:
    No()
0