結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー miya145592miya145592
提出日時 2023-05-19 23:08:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 696 ms / 2,000 ms
コード長 1,040 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 147,840 KB
最終ジャッジ日時 2023-08-23 04:05:38
合計ジャッジ時間 33,432 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
70,992 KB
testcase_01 AC 72 ms
71,248 KB
testcase_02 AC 283 ms
78,876 KB
testcase_03 AC 226 ms
80,760 KB
testcase_04 AC 199 ms
81,556 KB
testcase_05 AC 210 ms
81,736 KB
testcase_06 AC 210 ms
82,020 KB
testcase_07 AC 177 ms
80,672 KB
testcase_08 AC 229 ms
99,380 KB
testcase_09 AC 219 ms
98,048 KB
testcase_10 AC 199 ms
109,480 KB
testcase_11 AC 234 ms
100,784 KB
testcase_12 AC 206 ms
110,072 KB
testcase_13 AC 272 ms
104,920 KB
testcase_14 AC 211 ms
102,940 KB
testcase_15 AC 206 ms
98,604 KB
testcase_16 AC 235 ms
95,552 KB
testcase_17 AC 239 ms
97,972 KB
testcase_18 AC 252 ms
121,876 KB
testcase_19 AC 267 ms
132,392 KB
testcase_20 AC 256 ms
147,664 KB
testcase_21 AC 266 ms
146,524 KB
testcase_22 AC 251 ms
116,964 KB
testcase_23 AC 270 ms
147,788 KB
testcase_24 AC 272 ms
116,388 KB
testcase_25 AC 285 ms
118,632 KB
testcase_26 AC 247 ms
145,888 KB
testcase_27 AC 265 ms
116,512 KB
testcase_28 AC 264 ms
140,672 KB
testcase_29 AC 268 ms
138,400 KB
testcase_30 AC 267 ms
124,588 KB
testcase_31 AC 265 ms
147,840 KB
testcase_32 AC 249 ms
147,680 KB
testcase_33 AC 241 ms
127,912 KB
testcase_34 AC 274 ms
129,520 KB
testcase_35 AC 275 ms
130,324 KB
testcase_36 AC 274 ms
140,184 KB
testcase_37 AC 278 ms
127,744 KB
testcase_38 AC 510 ms
78,564 KB
testcase_39 AC 696 ms
81,948 KB
testcase_40 AC 214 ms
78,552 KB
testcase_41 AC 259 ms
80,256 KB
testcase_42 AC 257 ms
130,788 KB
testcase_43 AC 276 ms
130,888 KB
testcase_44 AC 188 ms
101,124 KB
testcase_45 AC 192 ms
100,984 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()))
    if N>0 and M>0:
        setA = set(A)
        setB = set(B)
        same = []
        diff = []
        for b in B:
            if b in setA:
                same.append(b)
            else:
                diff.append(b)
        if len(same)==0:
            print("No")
            continue

        print("Yes")
        for d in diff:
            print("Blue", d)
        for i, s in enumerate(same):
            if i%2==0:
                print("Blue", s)
                print("Red", s)
                if i==0:
                    for a in setA:
                        if a not in setB:
                            print("Red", a)
            else:
                print("Red", s)
                print("Blue", s)

    elif N>0:
        print("Yes")
        for a in A:
            print("Red", a)
    else:
        print("Yes")
        for b in B:
            print("Blue", b)
0