結果

問題 No.2629 A replace B replace C
ユーザー ntudantuda
提出日時 2024-02-17 13:34:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 75,876 KB
最終ジャッジ日時 2024-02-17 13:34:08
合計ジャッジ時間 6,412 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
56,348 KB
testcase_01 AC 57 ms
72,268 KB
testcase_02 AC 51 ms
70,076 KB
testcase_03 AC 57 ms
74,384 KB
testcase_04 AC 48 ms
65,988 KB
testcase_05 AC 47 ms
65,968 KB
testcase_06 AC 43 ms
61,652 KB
testcase_07 AC 56 ms
75,440 KB
testcase_08 AC 60 ms
75,568 KB
testcase_09 AC 66 ms
75,580 KB
testcase_10 AC 52 ms
70,220 KB
testcase_11 AC 69 ms
75,724 KB
testcase_12 AC 54 ms
72,908 KB
testcase_13 AC 53 ms
72,268 KB
testcase_14 AC 69 ms
75,724 KB
testcase_15 AC 62 ms
75,724 KB
testcase_16 AC 50 ms
70,076 KB
testcase_17 AC 49 ms
70,064 KB
testcase_18 AC 51 ms
72,112 KB
testcase_19 AC 49 ms
65,988 KB
testcase_20 AC 49 ms
70,064 KB
testcase_21 AC 65 ms
75,580 KB
testcase_22 AC 64 ms
75,596 KB
testcase_23 AC 62 ms
75,568 KB
testcase_24 AC 61 ms
75,588 KB
testcase_25 AC 62 ms
75,580 KB
testcase_26 AC 57 ms
75,440 KB
testcase_27 AC 62 ms
75,452 KB
testcase_28 AC 65 ms
75,724 KB
testcase_29 AC 49 ms
72,368 KB
testcase_30 AC 53 ms
72,252 KB
testcase_31 AC 38 ms
55,588 KB
testcase_32 AC 40 ms
55,588 KB
testcase_33 AC 39 ms
56,216 KB
testcase_34 AC 36 ms
55,588 KB
testcase_35 AC 38 ms
55,588 KB
testcase_36 AC 39 ms
56,136 KB
testcase_37 AC 38 ms
55,584 KB
testcase_38 AC 41 ms
55,584 KB
testcase_39 AC 39 ms
55,588 KB
testcase_40 AC 40 ms
55,588 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 65 ms
75,596 KB
testcase_52 AC 58 ms
75,568 KB
testcase_53 AC 46 ms
68,016 KB
testcase_54 AC 49 ms
72,132 KB
testcase_55 AC 48 ms
72,112 KB
testcase_56 AC 48 ms
68,016 KB
testcase_57 AC 64 ms
75,596 KB
testcase_58 AC 50 ms
72,132 KB
testcase_59 AC 63 ms
75,568 KB
testcase_60 AC 57 ms
75,440 KB
testcase_61 AC 37 ms
53,460 KB
testcase_62 AC 38 ms
53,460 KB
testcase_63 AC 37 ms
53,460 KB
testcase_64 AC 34 ms
53,460 KB
testcase_65 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
T = input()
if S == T:
    print("Yes")
    exit()

from collections import defaultdict
dic = defaultdict(int)
for i in range(N):
    if S[i] > T[i]:
        print("No")
        exit()
    elif S[i] < T[i]:
        dic[(S[i],T[i])] += 1
if dic[('A','B')] == 0:
    print("No")
    exit()
if dic[('A','B')] != dic[('B','C')]:
    print("No")
print("Yes")
0