結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー ニックネームニックネーム
提出日時 2023-05-19 21:45:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,271 ms / 2,000 ms
コード長 636 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 10,844 KB
実行使用メモリ 41,320 KB
最終ジャッジ日時 2023-08-23 02:48:33
合計ジャッジ時間 35,495 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,752 KB
testcase_01 AC 15 ms
7,708 KB
testcase_02 AC 219 ms
8,164 KB
testcase_03 AC 169 ms
10,260 KB
testcase_04 AC 170 ms
10,332 KB
testcase_05 AC 162 ms
10,524 KB
testcase_06 AC 168 ms
10,364 KB
testcase_07 AC 141 ms
10,768 KB
testcase_08 AC 191 ms
20,860 KB
testcase_09 AC 189 ms
18,212 KB
testcase_10 AC 174 ms
21,084 KB
testcase_11 AC 239 ms
22,216 KB
testcase_12 AC 172 ms
22,120 KB
testcase_13 AC 289 ms
20,768 KB
testcase_14 AC 197 ms
23,964 KB
testcase_15 AC 160 ms
19,812 KB
testcase_16 AC 234 ms
17,428 KB
testcase_17 AC 198 ms
20,212 KB
testcase_18 AC 305 ms
26,980 KB
testcase_19 AC 339 ms
33,236 KB
testcase_20 AC 324 ms
41,244 KB
testcase_21 AC 329 ms
41,136 KB
testcase_22 AC 305 ms
28,312 KB
testcase_23 AC 323 ms
41,312 KB
testcase_24 AC 322 ms
28,556 KB
testcase_25 AC 312 ms
27,568 KB
testcase_26 AC 320 ms
41,048 KB
testcase_27 AC 313 ms
28,292 KB
testcase_28 AC 319 ms
32,456 KB
testcase_29 AC 308 ms
31,560 KB
testcase_30 AC 322 ms
29,460 KB
testcase_31 AC 322 ms
41,204 KB
testcase_32 AC 317 ms
41,320 KB
testcase_33 AC 314 ms
40,200 KB
testcase_34 AC 329 ms
39,380 KB
testcase_35 AC 335 ms
32,320 KB
testcase_36 AC 332 ms
40,840 KB
testcase_37 AC 323 ms
31,608 KB
testcase_38 AC 1,137 ms
7,760 KB
testcase_39 AC 1,271 ms
7,684 KB
testcase_40 AC 256 ms
8,508 KB
testcase_41 AC 283 ms
8,572 KB
testcase_42 AC 340 ms
33,476 KB
testcase_43 AC 336 ms
33,564 KB
testcase_44 AC 321 ms
40,080 KB
testcase_45 AC 312 ms
40,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n,m = map(int,input().split())
    a = set(map(int,input().split()))
    b = set(map(int,input().split()))
    if m==0:
        print("Yes")
        for v in a: print("Red",v)
        continue
    if n==0:
        print("Yes")
        for v in b: print("Blue",v)
        continue
    c = a&b; a -= c; b -= c; f = 0
    if not c: print("No"); continue
    print("Yes")
    for v in a: print("Red",v)
    v = c.pop(); print("Red",v); print("Blue",v)
    for v in b: print("Blue",v)
    for v in c:
        if f: print("Red",v); print("Blue",v)
        else: print("Blue",v); print("Red",v)
        f ^= 1
0