結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー miho-4miho-4
提出日時 2023-05-19 22:15:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 813 ms / 2,000 ms
コード長 710 bytes
コンパイル時間 663 ms
コンパイル使用メモリ 86,600 KB
実行使用メモリ 140,444 KB
最終ジャッジ日時 2023-08-23 03:30:13
合計ジャッジ時間 34,603 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,460 KB
testcase_01 AC 78 ms
71,256 KB
testcase_02 AC 375 ms
79,448 KB
testcase_03 AC 233 ms
81,296 KB
testcase_04 AC 211 ms
80,404 KB
testcase_05 AC 235 ms
81,472 KB
testcase_06 AC 217 ms
82,436 KB
testcase_07 AC 185 ms
81,288 KB
testcase_08 AC 250 ms
100,812 KB
testcase_09 AC 224 ms
97,516 KB
testcase_10 AC 207 ms
105,300 KB
testcase_11 AC 258 ms
98,148 KB
testcase_12 AC 217 ms
109,076 KB
testcase_13 AC 275 ms
104,348 KB
testcase_14 AC 222 ms
102,444 KB
testcase_15 AC 205 ms
98,308 KB
testcase_16 AC 239 ms
93,028 KB
testcase_17 AC 245 ms
98,072 KB
testcase_18 AC 255 ms
117,948 KB
testcase_19 AC 308 ms
140,276 KB
testcase_20 AC 260 ms
135,616 KB
testcase_21 AC 295 ms
137,488 KB
testcase_22 AC 232 ms
114,280 KB
testcase_23 AC 287 ms
136,000 KB
testcase_24 AC 269 ms
119,564 KB
testcase_25 AC 272 ms
118,296 KB
testcase_26 AC 252 ms
133,916 KB
testcase_27 AC 262 ms
115,028 KB
testcase_28 AC 271 ms
132,296 KB
testcase_29 AC 267 ms
128,952 KB
testcase_30 AC 287 ms
131,712 KB
testcase_31 AC 254 ms
135,384 KB
testcase_32 AC 253 ms
135,852 KB
testcase_33 AC 252 ms
127,684 KB
testcase_34 AC 280 ms
130,620 KB
testcase_35 AC 299 ms
136,396 KB
testcase_36 AC 280 ms
133,324 KB
testcase_37 AC 277 ms
124,312 KB
testcase_38 AC 564 ms
78,696 KB
testcase_39 AC 813 ms
82,276 KB
testcase_40 AC 256 ms
78,324 KB
testcase_41 AC 275 ms
79,980 KB
testcase_42 AC 311 ms
140,444 KB
testcase_43 AC 287 ms
140,408 KB
testcase_44 AC 237 ms
131,408 KB
testcase_45 AC 240 ms
131,672 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()))
  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 i in range(1,len(LS)):
      e=LS[i]
      if i%2==1:
        print("Blue",e)
        print("Red",e)
      else:
        print("Red",e)
        print("Blue",e)
0