結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー qibqib
提出日時 2023-05-20 14:14:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 672 ms / 2,000 ms
コード長 615 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 136,840 KB
最終ジャッジ日時 2023-08-23 09:35:17
合計ジャッジ時間 35,637 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
71,320 KB
testcase_01 AC 89 ms
71,284 KB
testcase_02 AC 299 ms
80,172 KB
testcase_03 AC 228 ms
79,452 KB
testcase_04 AC 170 ms
79,292 KB
testcase_05 AC 171 ms
79,648 KB
testcase_06 AC 178 ms
79,908 KB
testcase_07 AC 162 ms
78,448 KB
testcase_08 AC 201 ms
100,072 KB
testcase_09 AC 180 ms
97,720 KB
testcase_10 AC 165 ms
104,096 KB
testcase_11 AC 203 ms
104,304 KB
testcase_12 AC 179 ms
108,272 KB
testcase_13 AC 218 ms
101,744 KB
testcase_14 AC 183 ms
102,396 KB
testcase_15 AC 172 ms
98,812 KB
testcase_16 AC 194 ms
93,128 KB
testcase_17 AC 202 ms
97,936 KB
testcase_18 AC 197 ms
114,108 KB
testcase_19 AC 243 ms
129,004 KB
testcase_20 AC 204 ms
135,524 KB
testcase_21 AC 226 ms
136,840 KB
testcase_22 AC 199 ms
118,984 KB
testcase_23 AC 215 ms
135,960 KB
testcase_24 AC 220 ms
118,980 KB
testcase_25 AC 207 ms
118,744 KB
testcase_26 AC 197 ms
133,616 KB
testcase_27 AC 213 ms
119,136 KB
testcase_28 AC 212 ms
129,040 KB
testcase_29 AC 210 ms
124,420 KB
testcase_30 AC 231 ms
114,620 KB
testcase_31 AC 204 ms
135,684 KB
testcase_32 AC 207 ms
135,600 KB
testcase_33 AC 205 ms
128,344 KB
testcase_34 AC 217 ms
130,840 KB
testcase_35 AC 234 ms
122,704 KB
testcase_36 AC 218 ms
131,540 KB
testcase_37 AC 213 ms
113,884 KB
testcase_38 AC 535 ms
78,380 KB
testcase_39 AC 672 ms
81,100 KB
testcase_40 AC 206 ms
77,960 KB
testcase_41 AC 214 ms
78,660 KB
testcase_42 AC 235 ms
127,748 KB
testcase_43 AC 229 ms
127,268 KB
testcase_44 AC 204 ms
131,348 KB
testcase_45 AC 200 ms
131,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())

color = ["Red", "Blue"]

for _ in range(t):
  n, m = map(int, input().split())
  a = set(list(map(int, input().split())))
  b = set(list(map(int, input().split())))

  xs = a & b
  if len(a) > 0 and len(b) > 0 and len(xs) == 0:
    print("No")
    continue

  a -= xs
  b -= xs
  xs = list(xs)

  print("Yes")
  for x in b:
    print(f"{color[1]} {x}")

  if len(xs) > 0:
    x = xs.pop()
    print(f"{color[1]} {x}")
    print(f"{color[0]} {x}")

  for x in a:
    print(f"{color[0]} {x}")

  for i in range(len(xs)):
    print(f"{color[i % 2]} {xs[i]}")
    print(f"{color[1 - i % 2]} {xs[i]}")
0