結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー ntudantuda
提出日時 2023-05-20 11:35:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 650 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 1,442 ms
コンパイル使用メモリ 86,148 KB
実行使用メモリ 152,160 KB
最終ジャッジ日時 2023-08-23 08:38:46
合計ジャッジ時間 36,694 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,320 KB
testcase_01 AC 76 ms
71,444 KB
testcase_02 AC 354 ms
79,228 KB
testcase_03 AC 225 ms
82,732 KB
testcase_04 AC 212 ms
82,088 KB
testcase_05 AC 214 ms
82,168 KB
testcase_06 AC 220 ms
83,280 KB
testcase_07 AC 194 ms
81,532 KB
testcase_08 AC 239 ms
101,488 KB
testcase_09 AC 234 ms
105,016 KB
testcase_10 AC 222 ms
115,112 KB
testcase_11 AC 251 ms
99,944 KB
testcase_12 AC 226 ms
119,616 KB
testcase_13 AC 282 ms
106,864 KB
testcase_14 AC 232 ms
109,996 KB
testcase_15 AC 223 ms
108,284 KB
testcase_16 AC 254 ms
96,876 KB
testcase_17 AC 258 ms
103,192 KB
testcase_18 AC 270 ms
126,908 KB
testcase_19 AC 289 ms
124,096 KB
testcase_20 AC 327 ms
152,160 KB
testcase_21 AC 296 ms
145,988 KB
testcase_22 AC 265 ms
122,028 KB
testcase_23 AC 314 ms
148,612 KB
testcase_24 AC 290 ms
116,196 KB
testcase_25 AC 292 ms
121,360 KB
testcase_26 AC 285 ms
148,148 KB
testcase_27 AC 292 ms
120,124 KB
testcase_28 AC 299 ms
140,736 KB
testcase_29 AC 306 ms
141,848 KB
testcase_30 AC 295 ms
119,356 KB
testcase_31 AC 303 ms
152,104 KB
testcase_32 AC 286 ms
152,012 KB
testcase_33 AC 278 ms
144,932 KB
testcase_34 AC 285 ms
141,168 KB
testcase_35 AC 295 ms
123,076 KB
testcase_36 AC 291 ms
139,160 KB
testcase_37 AC 284 ms
129,488 KB
testcase_38 AC 554 ms
78,556 KB
testcase_39 AC 650 ms
80,020 KB
testcase_40 AC 239 ms
79,240 KB
testcase_41 AC 276 ms
79,384 KB
testcase_42 AC 272 ms
120,448 KB
testcase_43 AC 270 ms
120,572 KB
testcase_44 AC 249 ms
123,344 KB
testcase_45 AC 236 ms
123,572 KB
権限があれば一括ダウンロードができます

ソースコード

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)

    if NC > 0:
        i = next(iter(CO))
        print("Red", i)
        print("Blue", i)
        CO.remove(i)

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

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

0