結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー ああいいああいい
提出日時 2023-05-22 22:54:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 903 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 139,296 KB
最終ジャッジ日時 2023-08-24 03:45:35
合計ジャッジ時間 31,535 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,320 KB
testcase_01 AC 73 ms
71,236 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 522 ms
78,676 KB
testcase_39 AC 753 ms
82,708 KB
testcase_40 AC 235 ms
78,956 KB
testcase_41 AC 268 ms
79,684 KB
testcase_42 AC 282 ms
138,932 KB
testcase_43 AC 274 ms
139,296 KB
testcase_44 AC 223 ms
131,888 KB
testcase_45 AC 224 ms
131,908 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()))
    a = set(A)
    b = set(B)
    c = a & b

    if N == 0:
        print('Yes')
        for bb in B:
            print('Blue',bb)
        continue
    if M == 0:
        print('Yes')
        for aa in A:
            print('Red',aa)
        continue
    if len(c) == 0:
        print('No')
        continue
    print('Yes')
    for aa in A:
        if aa not in c:
            print('Red',aa)

    u = c.pop()
    print('Red',u)
    print('Blue',u)
    for bb in B:
        if bb not in c and bb != u:
            print('Blue',u)
    now = True
    while c:
        u = c.pop()
        if now:
            print("Blue",u)
            print("Red",u)
        else:
            print('Red',u)
            print('Blue',u)
        now = not now
            
0