結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー miya145592miya145592
提出日時 2023-05-19 23:19:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,269 ms / 2,000 ms
コード長 1,075 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 10,848 KB
実行使用メモリ 36,024 KB
最終ジャッジ日時 2023-08-23 04:10:40
合計ジャッジ時間 35,002 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,344 KB
testcase_01 AC 15 ms
7,968 KB
testcase_02 AC 240 ms
8,472 KB
testcase_03 AC 178 ms
10,464 KB
testcase_04 AC 185 ms
10,940 KB
testcase_05 AC 180 ms
10,948 KB
testcase_06 AC 181 ms
10,820 KB
testcase_07 AC 154 ms
11,024 KB
testcase_08 AC 201 ms
21,760 KB
testcase_09 AC 207 ms
18,736 KB
testcase_10 AC 186 ms
22,100 KB
testcase_11 AC 252 ms
22,124 KB
testcase_12 AC 183 ms
22,304 KB
testcase_13 AC 296 ms
22,212 KB
testcase_14 AC 212 ms
21,448 KB
testcase_15 AC 177 ms
21,168 KB
testcase_16 AC 245 ms
18,440 KB
testcase_17 AC 212 ms
22,036 KB
testcase_18 AC 315 ms
26,352 KB
testcase_19 AC 347 ms
30,964 KB
testcase_20 AC 333 ms
35,840 KB
testcase_21 AC 338 ms
36,024 KB
testcase_22 AC 319 ms
25,596 KB
testcase_23 AC 331 ms
35,668 KB
testcase_24 AC 329 ms
25,596 KB
testcase_25 AC 327 ms
26,296 KB
testcase_26 AC 329 ms
35,364 KB
testcase_27 AC 328 ms
25,624 KB
testcase_28 AC 327 ms
29,240 KB
testcase_29 AC 332 ms
29,488 KB
testcase_30 AC 339 ms
26,624 KB
testcase_31 AC 326 ms
35,756 KB
testcase_32 AC 329 ms
35,904 KB
testcase_33 AC 326 ms
34,044 KB
testcase_34 AC 334 ms
31,336 KB
testcase_35 AC 355 ms
30,232 KB
testcase_36 AC 339 ms
34,680 KB
testcase_37 AC 327 ms
31,536 KB
testcase_38 AC 1,114 ms
8,376 KB
testcase_39 AC 1,269 ms
8,324 KB
testcase_40 AC 243 ms
8,576 KB
testcase_41 AC 294 ms
8,808 KB
testcase_42 AC 354 ms
30,208 KB
testcase_43 AC 373 ms
30,128 KB
testcase_44 AC 254 ms
30,080 KB
testcase_45 AC 262 ms
30,076 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