結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー KudeKude
提出日時 2023-05-19 21:44:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 694 ms / 2,000 ms
コード長 913 bytes
コンパイル時間 487 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 156,832 KB
最終ジャッジ日時 2023-08-23 02:47:22
合計ジャッジ時間 33,807 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,196 KB
testcase_01 AC 73 ms
71,256 KB
testcase_02 AC 317 ms
79,424 KB
testcase_03 AC 219 ms
83,432 KB
testcase_04 AC 205 ms
83,664 KB
testcase_05 AC 201 ms
83,092 KB
testcase_06 AC 209 ms
83,848 KB
testcase_07 AC 184 ms
81,324 KB
testcase_08 AC 225 ms
100,976 KB
testcase_09 AC 227 ms
99,040 KB
testcase_10 AC 232 ms
108,520 KB
testcase_11 AC 230 ms
100,012 KB
testcase_12 AC 221 ms
111,192 KB
testcase_13 AC 279 ms
105,836 KB
testcase_14 AC 240 ms
102,864 KB
testcase_15 AC 215 ms
101,596 KB
testcase_16 AC 261 ms
100,064 KB
testcase_17 AC 243 ms
100,088 KB
testcase_18 AC 265 ms
132,444 KB
testcase_19 AC 267 ms
123,708 KB
testcase_20 AC 283 ms
156,508 KB
testcase_21 AC 279 ms
151,296 KB
testcase_22 AC 271 ms
127,300 KB
testcase_23 AC 284 ms
156,144 KB
testcase_24 AC 272 ms
116,320 KB
testcase_25 AC 273 ms
123,296 KB
testcase_26 AC 284 ms
156,448 KB
testcase_27 AC 273 ms
126,280 KB
testcase_28 AC 282 ms
150,200 KB
testcase_29 AC 285 ms
149,544 KB
testcase_30 AC 273 ms
118,764 KB
testcase_31 AC 286 ms
156,832 KB
testcase_32 AC 283 ms
156,800 KB
testcase_33 AC 281 ms
148,792 KB
testcase_34 AC 282 ms
144,324 KB
testcase_35 AC 269 ms
119,788 KB
testcase_36 AC 275 ms
145,016 KB
testcase_37 AC 282 ms
133,216 KB
testcase_38 AC 566 ms
79,004 KB
testcase_39 AC 694 ms
81,852 KB
testcase_40 AC 260 ms
80,088 KB
testcase_41 AC 252 ms
79,424 KB
testcase_42 AC 253 ms
117,372 KB
testcase_43 AC 254 ms
116,992 KB
testcase_44 AC 259 ms
137,736 KB
testcase_45 AC 269 ms
141,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n, m = map(int, input().split())
    d = {x : 1 for x in map(int, input().split())}
    for x in map(int, input().split()):
        d[x] = d.get(x, 0) | 2
    v = [[], [], []]
    for x, t in d.items():
        v[t - 1].append(x)
    ans = []
    if not v[2]:
        if v[0] and v[1]:
            print('No')
            continue
        elif v[0]:
            ans = [(0, x) for x in v[0]]
        else:
            ans = [(1, x) for x in v[1]]
    else:
        for x in v[2]:
            if not ans:
                ans.extend((0, x) for x in v[0])
                ans.append((0, x))
                ans.append((1, x))
                ans.extend((1, x) for x in v[1])
            else:
                t = ans[-1][0]
                ans.append((t, x))
                ans.append((t ^ 1, x))
    print('Yes')
    for t, x in ans:
        print(('Red' if t == 0 else 'Blue'), x)
0