結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー ntudantuda
提出日時 2023-05-20 11:04:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 82,328 KB
実行使用メモリ 149,264 KB
最終ジャッジ日時 2024-12-21 09:38:35
合計ジャッジ時間 32,624 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for t in range(T):
    N,M = map(int,input().split())
    A = set(map(int,input().split()))
    B = set(map(int,input().split()))
    CO = A & B
    AO = A - CO
    BO = B - CO
    NC = len(CO)
    NA = len(AO)
    NB = len(BO)

    if NC == 0 and NA * NB > 0:
        print("No")
        continue

    print("Yes")

    for i in AO:
        print("Red",i)

    st = 0
    for i in CO:
        if st == 0:
            print("Red",i)
            print("Blue",i)
        else:
            print("Blue",i)
            print("Red",i)
        st ^= 1

    for i in BO:
        print("Blue",i)
0