結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー miya145592miya145592
提出日時 2023-05-19 23:18:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 724 ms / 2,000 ms
コード長 1,075 bytes
コンパイル時間 484 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 147,864 KB
最終ジャッジ日時 2023-08-23 04:10:04
合計ジャッジ時間 33,931 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,496 KB
testcase_01 AC 77 ms
71,528 KB
testcase_02 AC 307 ms
78,852 KB
testcase_03 AC 224 ms
80,592 KB
testcase_04 AC 218 ms
81,608 KB
testcase_05 AC 220 ms
81,480 KB
testcase_06 AC 223 ms
81,892 KB
testcase_07 AC 191 ms
80,700 KB
testcase_08 AC 245 ms
99,420 KB
testcase_09 AC 237 ms
98,440 KB
testcase_10 AC 213 ms
109,460 KB
testcase_11 AC 251 ms
100,892 KB
testcase_12 AC 221 ms
110,176 KB
testcase_13 AC 288 ms
104,936 KB
testcase_14 AC 226 ms
103,144 KB
testcase_15 AC 219 ms
98,584 KB
testcase_16 AC 251 ms
95,732 KB
testcase_17 AC 257 ms
98,352 KB
testcase_18 AC 277 ms
122,200 KB
testcase_19 AC 291 ms
132,400 KB
testcase_20 AC 274 ms
147,768 KB
testcase_21 AC 286 ms
146,840 KB
testcase_22 AC 274 ms
117,508 KB
testcase_23 AC 292 ms
147,752 KB
testcase_24 AC 299 ms
116,544 KB
testcase_25 AC 296 ms
118,768 KB
testcase_26 AC 271 ms
146,052 KB
testcase_27 AC 298 ms
116,452 KB
testcase_28 AC 283 ms
140,644 KB
testcase_29 AC 291 ms
138,768 KB
testcase_30 AC 294 ms
124,608 KB
testcase_31 AC 271 ms
147,864 KB
testcase_32 AC 265 ms
147,716 KB
testcase_33 AC 268 ms
128,300 KB
testcase_34 AC 298 ms
129,692 KB
testcase_35 AC 290 ms
130,472 KB
testcase_36 AC 286 ms
140,144 KB
testcase_37 AC 293 ms
127,692 KB
testcase_38 AC 523 ms
78,572 KB
testcase_39 AC 724 ms
81,840 KB
testcase_40 AC 227 ms
78,676 KB
testcase_41 AC 270 ms
80,244 KB
testcase_42 AC 274 ms
130,996 KB
testcase_43 AC 267 ms
131,120 KB
testcase_44 AC 202 ms
101,048 KB
testcase_45 AC 201 ms
100,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    if N>0 and M>0:
        setA = set(A)
        setB = set(B)
        same = []
        diff = []
        for b in B:
            if b in setA:
                same.append(b)
            else:
                diff.append(b)
        if len(same)==0:
            print("No")
            continue

        print("Yes")
        for d in diff:
            print("Blue", d)
        for i, s in enumerate(same):
            if i%2==0:
                print("Blue", s)
                print("Red", s)
                if i==0:
                    for a in setA:
                        if a not in setB:
                            print("Red", a)
            else:
                print("Red", s)
                print("Blue", s)

    elif N>0:
        print("Yes")
        for a in A:
            print("Red", a)
    elif M>0:
        print("Yes")
        for b in B:
            print("Blue", b)
    else:
        print("Yes")
0