結果
問題 | No.2307 [Cherry 5 th Tune *] Cool 46 |
ユーザー | とろちゃ |
提出日時 | 2023-05-19 22:37:59 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,793 bytes |
コンパイル時間 | 295 ms |
コンパイル使用メモリ | 82,440 KB |
実行使用メモリ | 146,780 KB |
最終ジャッジ日時 | 2024-06-01 01:30:10 |
合計ジャッジ時間 | 25,887 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 39 ms
52,884 KB |
testcase_01 | AC | 41 ms
52,876 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 251 ms
126,960 KB |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | AC | 224 ms
77,812 KB |
testcase_39 | AC | 336 ms
78,544 KB |
testcase_40 | AC | 135 ms
76,988 KB |
testcase_41 | AC | 238 ms
78,820 KB |
testcase_42 | AC | 241 ms
113,392 KB |
testcase_43 | AC | 241 ms
113,376 KB |
testcase_44 | AC | 192 ms
146,728 KB |
testcase_45 | AC | 193 ms
146,780 KB |
ソースコード
# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1") # from bisect import * # from collections import * # from heapq import * # from itertools import * # from math import * # from datetime import * # from decimal import* # from string import ascii_lowercase,ascii_uppercase # import numpy as np import sys import os # sys.setrecursionlimit(10**6) INF = 10**18 MOD = 998244353 # MOD = 10**9 + 7 File = open("input.txt", "r") if os.path.exists("input.txt") else sys.stdin def input(): return File.readline()[:-1] # /////////////////////////////////////////////////////////////////////////// T = int(input()) def f(l, s): res = 0 flag = [0] * (len(l) + 1) for i in range(len(l)): if l[i] in s: flag[i] = 1 res += 1 return flag, res for _ in range(T): N, M = map(int, input().split()) A = list(map(int, input().split())) As = set(A) B = list(map(int, input().split())) Bs = set(B) if len(A) == 0 or len(B) == 0: print("Yes") print(*["Red " + str(i) for i in A], sep="\n") if len(A) else print( *["Blue " + str(i) for i in B], sep="\n" ) continue flagA, cnt1 = f(A, Bs) flagB, cnt2 = f(B, As) if cnt1 == 0 or cnt2 == 0: print("No") continue print("Yes") for i in range(N): if not flagA[i]: print("Red", A[i]) parity = 1 for i in range(N): if flagA[i]: if parity: print("Red", A[i]) print("Blue", A[i]) else: print("Blue", A[i]) print("Red", A[i]) parity ^= 1 if i == 1: for j in range(M): if not flagB[j]: print("Blue", B[j])