結果
| 問題 |
No.2307 [Cherry 5 th Tune *] Cool 46
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-20 14:14:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 659 ms / 2,000 ms |
| コード長 | 615 bytes |
| コンパイル時間 | 413 ms |
| コンパイル使用メモリ | 82,028 KB |
| 実行使用メモリ | 133,084 KB |
| 最終ジャッジ日時 | 2024-12-21 11:16:32 |
| 合計ジャッジ時間 | 28,458 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 46 |
ソースコード
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]}")