結果
問題 | No.2307 [Cherry 5 th Tune *] Cool 46 |
ユーザー |
![]() |
提出日時 | 2023-05-19 21:38:20 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,637 ms / 2,000 ms |
コード長 | 750 bytes |
コンパイル時間 | 821 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 37,520 KB |
最終ジャッジ日時 | 2024-12-20 03:46:53 |
合計ジャッジ時間 | 39,024 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 46 |
ソースコード
for _ in range(int(input())): n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) if m==0: print("Yes") for v in a: print("Red",v) continue if n==0: print("Yes") for v in b: print("Blue",v) continue c = set(a)&set(b); d = []; e = []; f = 0 for v in a: if v not in c: d.append(v) for v in b: if v not in c: e.append(v) if not c: print("No"); continue print("Yes") for v in d: print("Red",v) v = c.pop(); print("Red",v); print("Blue",v) for v in e: print("Blue",v) for v in c: if f: print("Red",v); print("Blue",v) else: print("Blue",v); print("Red",v) f ^= 1