結果
問題 | No.2307 [Cherry 5 th Tune *] Cool 46 |
ユーザー |
|
提出日時 | 2023-05-19 22:02:41 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 350 ms / 2,000 ms |
コード長 | 1,105 bytes |
コンパイル時間 | 531 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 167,800 KB |
最終ジャッジ日時 | 2024-12-21 02:40:48 |
合計ジャッジ時間 | 34,802 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 46 |
ソースコード
import sysfrom functools import partial# import pypyjit# pypyjit.set_param('max_unroll_recursion = -1')sys.setrecursionlimit(500005)stdin = sys.stdinns = lambda: stdin.readline().strip()ni = lambda: int(ns())na = lambda: list(map(int, stdin.readline().split()))nz = lambda: list(map(lambda x: int(x)-1, stdin.readline().split())) # 遅いprinta = partial(print, sep="\n") # printa(*A) で各要素を改行して出力mod = 1000000007 # 998244353inf = 10 ** 18T = ni()def solve():N, M = na()A = set(na())B = set(na())C = A & BRed = A - CBlue = B - Cif N and M and not C:print("No")returnprint("Yes")if Red:for r in Red:print("Red", r)if C:x = C.pop()print("Red", x)print("Blue", x)if Blue:for b in Blue:print("Blue", b)f = 0for c in C:if not f:print("Blue", c)print("Red", c)else:print("Red", c)print("Blue", c)f = f ^ 1for i in range(T):solve()