結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー ああいいああいい
提出日時 2023-05-22 22:56:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 754 ms / 2,000 ms
コード長 904 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 85,952 KB
実行使用メモリ 139,076 KB
最終ジャッジ日時 2023-08-24 03:46:37
合計ジャッジ時間 34,259 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,016 KB
testcase_01 AC 71 ms
71,156 KB
testcase_02 AC 319 ms
79,300 KB
testcase_03 AC 217 ms
81,284 KB
testcase_04 AC 219 ms
80,676 KB
testcase_05 AC 221 ms
81,144 KB
testcase_06 AC 223 ms
81,536 KB
testcase_07 AC 188 ms
80,888 KB
testcase_08 AC 247 ms
100,240 KB
testcase_09 AC 230 ms
97,564 KB
testcase_10 AC 201 ms
105,504 KB
testcase_11 AC 248 ms
97,224 KB
testcase_12 AC 218 ms
108,860 KB
testcase_13 AC 277 ms
98,796 KB
testcase_14 AC 231 ms
102,480 KB
testcase_15 AC 204 ms
97,896 KB
testcase_16 AC 237 ms
92,864 KB
testcase_17 AC 240 ms
97,724 KB
testcase_18 AC 256 ms
117,824 KB
testcase_19 AC 309 ms
138,504 KB
testcase_20 AC 263 ms
135,740 KB
testcase_21 AC 291 ms
137,332 KB
testcase_22 AC 239 ms
114,132 KB
testcase_23 AC 282 ms
135,816 KB
testcase_24 AC 288 ms
119,052 KB
testcase_25 AC 285 ms
118,016 KB
testcase_26 AC 259 ms
133,740 KB
testcase_27 AC 307 ms
114,868 KB
testcase_28 AC 290 ms
131,892 KB
testcase_29 AC 271 ms
129,076 KB
testcase_30 AC 309 ms
130,392 KB
testcase_31 AC 257 ms
134,748 KB
testcase_32 AC 269 ms
135,708 KB
testcase_33 AC 254 ms
127,492 KB
testcase_34 AC 304 ms
130,532 KB
testcase_35 AC 329 ms
135,380 KB
testcase_36 AC 282 ms
132,904 KB
testcase_37 AC 276 ms
124,276 KB
testcase_38 AC 531 ms
78,180 KB
testcase_39 AC 754 ms
82,460 KB
testcase_40 AC 239 ms
78,512 KB
testcase_41 AC 286 ms
79,384 KB
testcase_42 AC 300 ms
138,684 KB
testcase_43 AC 300 ms
139,076 KB
testcase_44 AC 231 ms
131,408 KB
testcase_45 AC 238 ms
131,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

for _ in range(T):
    N,M = map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    a = set(A)
    b = set(B)
    c = a & b

    if N == 0:
        print('Yes')
        for bb in B:
            print('Blue',bb)
        continue
    if M == 0:
        print('Yes')
        for aa in A:
            print('Red',aa)
        continue
    if len(c) == 0:
        print('No')
        continue
    print('Yes')
    for aa in A:
        if aa not in c:
            print('Red',aa)

    u = c.pop()
    print('Red',u)
    print('Blue',u)
    for bb in B:
        if bb not in c and bb != u:
            print('Blue',bb)
    now = True
    while c:
        u = c.pop()
        if now:
            print("Blue",u)
            print("Red",u)
        else:
            print('Red',u)
            print('Blue',u)
        now = not now
            
0