結果
| 問題 |
No.2307 [Cherry 5 th Tune *] Cool 46
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-19 22:08:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 606 bytes |
| コンパイル時間 | 401 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 137,984 KB |
| 最終ジャッジ日時 | 2024-12-21 02:50:33 |
| 合計ジャッジ時間 | 32,139 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 WA * 38 |
ソースコード
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()))
SA,SB=set(A),set(B)
S=SA&SB
if 0<n and 0<m and len(S)==0:
print("No")
continue
print("Yes")
if n==0:
for e in SB:
print("Blue",e)
continue
if m==0:
for e in SA:
print("Red",e)
continue
LS=list(S)
SA-=S
SB-=S
for e in SA:
print("Red",e)
print("Red",LS[0])
print("Blue",LS[0])
for e in SB:
print("Blue",e)
if 1<len(LS):
for e in LS[1:]:
print("Blue",e)
print("Red",e)