結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,868 KB
testcase_01 AC 15 ms
7,852 KB
testcase_02 AC 248 ms
8,200 KB
testcase_03 AC 192 ms
10,276 KB
testcase_04 AC 189 ms
10,392 KB
testcase_05 AC 186 ms
10,320 KB
testcase_06 AC 190 ms
10,228 KB
testcase_07 AC 161 ms
10,700 KB
testcase_08 AC 212 ms
23,372 KB
testcase_09 AC 207 ms
18,844 KB
testcase_10 AC 186 ms
20,140 KB
testcase_11 AC 251 ms
24,004 KB
testcase_12 AC 181 ms
20,132 KB
testcase_13 AC 289 ms
21,300 KB
testcase_14 AC 209 ms
21,228 KB
testcase_15 AC 177 ms
18,964 KB
testcase_16 AC 244 ms
18,200 KB
testcase_17 AC 211 ms
20,432 KB
testcase_18 AC 299 ms
26,428 KB
testcase_19 AC 352 ms
34,844 KB
testcase_20 AC 313 ms
35,668 KB
testcase_21 AC 339 ms
35,784 KB
testcase_22 AC 307 ms
25,508 KB
testcase_23 AC 320 ms
35,540 KB
testcase_24 AC 326 ms
27,676 KB
testcase_25 AC 311 ms
26,444 KB
testcase_26 AC 317 ms
35,420 KB
testcase_27 AC 309 ms
25,508 KB
testcase_28 AC 310 ms
29,316 KB
testcase_29 AC 314 ms
29,460 KB
testcase_30 AC 336 ms
28,336 KB
testcase_31 AC 312 ms
35,784 KB
testcase_32 AC 314 ms
35,748 KB
testcase_33 AC 315 ms
32,452 KB
testcase_34 AC 327 ms
32,528 KB
testcase_35 AC 337 ms
30,116 KB
testcase_36 AC 324 ms
34,648 KB
testcase_37 AC 318 ms
31,308 KB
testcase_38 AC 1,130 ms
7,772 KB
testcase_39 AC 1,282 ms
8,288 KB
testcase_40 AC 240 ms
8,528 KB
testcase_41 AC 298 ms
8,572 KB
testcase_42 AC 349 ms
34,052 KB
testcase_43 AC 359 ms
34,136 KB
testcase_44 AC 258 ms
29,972 KB
testcase_45 AC 258 ms
29,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    b = list(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 = set(a)&set(b); d = []; e = []; f = 0
    for v in a:
        if v not in c: d.append(v)
    for v in b:
        if v not in c: e.append(v)
    if not c: print("No"); continue
    print("Yes")
    for v in d: print("Red",v)
    v = c.pop(); print("Red",v); print("Blue",v)
    for v in e: 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