結果
問題 |
No.2307 [Cherry 5 th Tune *] Cool 46
|
ユーザー |
|
提出日時 | 2023-05-19 22:37:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 951 bytes |
コンパイル時間 | 275 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 37,644 KB |
最終ジャッジ日時 | 2024-12-21 03:21:36 |
合計ジャッジ時間 | 33,384 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 WA * 18 |
ソースコード
def solve(): n,m = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) sA = set(A) sB = set(B) sames = [] for b in B: if b in sA: sames.append(b) if n == 0 or m == 0: for a in A: print(f"Red {a}") for b in B: print(f"Blue {b}") return if sames == []: print("No") return print("Yes") for a in A: if a not in sB: print(f"Red {a}") l = sames.pop() print(f"Red {l}") print(f"Blue {l}") for b in B: if b not in sA: print(f"Blue {b}") for i,l in enumerate(sames): if i%2: print(f"Red {l}") print(f"Blue {l}") else: print(f"Blue {l}") print(f"Red {l}") return t = int(input()) for _ in range(t): solve()