結果

問題 No.2629 A replace B replace C
ユーザー KoiKoi
提出日時 2024-02-16 21:32:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 78,968 KB
最終ジャッジ日時 2024-02-16 21:32:53
合計ジャッジ時間 5,473 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
78,968 KB
testcase_01 AC 53 ms
70,728 KB
testcase_02 AC 54 ms
70,520 KB
testcase_03 AC 58 ms
77,364 KB
testcase_04 AC 51 ms
64,696 KB
testcase_05 AC 50 ms
68,244 KB
testcase_06 AC 45 ms
65,900 KB
testcase_07 AC 53 ms
70,464 KB
testcase_08 AC 54 ms
70,892 KB
testcase_09 AC 58 ms
73,608 KB
testcase_10 AC 55 ms
73,324 KB
testcase_11 AC 58 ms
73,560 KB
testcase_12 AC 57 ms
73,972 KB
testcase_13 AC 52 ms
68,040 KB
testcase_14 AC 58 ms
73,464 KB
testcase_15 AC 54 ms
73,248 KB
testcase_16 AC 51 ms
70,360 KB
testcase_17 AC 52 ms
71,044 KB
testcase_18 AC 54 ms
73,472 KB
testcase_19 AC 49 ms
67,936 KB
testcase_20 AC 51 ms
70,400 KB
testcase_21 AC 57 ms
73,416 KB
testcase_22 AC 54 ms
70,400 KB
testcase_23 AC 57 ms
73,560 KB
testcase_24 AC 55 ms
73,432 KB
testcase_25 AC 55 ms
70,864 KB
testcase_26 AC 53 ms
70,648 KB
testcase_27 AC 54 ms
70,268 KB
testcase_28 AC 57 ms
73,440 KB
testcase_29 AC 49 ms
68,056 KB
testcase_30 AC 52 ms
67,480 KB
testcase_31 AC 45 ms
65,564 KB
testcase_32 AC 45 ms
65,456 KB
testcase_33 AC 46 ms
69,384 KB
testcase_34 AC 43 ms
62,776 KB
testcase_35 AC 44 ms
65,172 KB
testcase_36 AC 46 ms
68,708 KB
testcase_37 AC 46 ms
67,968 KB
testcase_38 AC 46 ms
67,932 KB
testcase_39 AC 43 ms
64,932 KB
testcase_40 AC 44 ms
65,600 KB
testcase_41 AC 54 ms
70,464 KB
testcase_42 AC 56 ms
73,120 KB
testcase_43 AC 56 ms
70,872 KB
testcase_44 AC 54 ms
71,092 KB
testcase_45 AC 60 ms
75,892 KB
testcase_46 AC 60 ms
76,992 KB
testcase_47 AC 55 ms
71,140 KB
testcase_48 AC 55 ms
70,560 KB
testcase_49 AC 50 ms
68,196 KB
testcase_50 AC 57 ms
73,344 KB
testcase_51 AC 54 ms
70,712 KB
testcase_52 AC 54 ms
70,964 KB
testcase_53 AC 45 ms
62,948 KB
testcase_54 AC 47 ms
65,408 KB
testcase_55 AC 47 ms
65,644 KB
testcase_56 AC 45 ms
62,748 KB
testcase_57 AC 56 ms
70,872 KB
testcase_58 AC 48 ms
65,484 KB
testcase_59 AC 57 ms
73,772 KB
testcase_60 AC 51 ms
68,228 KB
testcase_61 AC 37 ms
53,460 KB
testcase_62 AC 37 ms
53,460 KB
testcase_63 AC 37 ms
53,460 KB
testcase_64 AC 37 ms
53,460 KB
testcase_65 AC 37 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
S=list(input())
T=list(input())
x=0
y=0
z=0
ans="Yes"
for i in range(N):
    if(S[i]>T[i]):
        ans="No"
        break
    elif(S[i]<T[i]):
        if(S[i]=="A" and T[i]=="B"):
            x+=1
        if(S[i]=="A" and T[i]=="C"):
            y+=1
        if(S[i]=="B" and T[i]=="C"):
            z+=1
if(z==0 and (x+y)>0):
    ans="No"
else:
    if(x!=z):
        ans="No"
print(ans)
0