結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー KudeKude
提出日時 2023-05-19 22:09:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,001 bytes
コンパイル時間 815 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 259,208 KB
最終ジャッジ日時 2023-08-23 03:19:12
合計ジャッジ時間 7,916 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 OLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
ins = list(map(int, sys.stdin.buffer.read().split()))
ins.reverse()
for _ in range(ins.pop()):
    n, m = ins.pop(), ins.pop()
    print(ins, n, m)
    d = {ins.pop() : 1 for _ in range(n)}
    for _ in range(m):
        x = ins.pop()
        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