結果
問題 | No.2307 [Cherry 5 th Tune *] Cool 46 |
ユーザー |
![]() |
提出日時 | 2023-05-19 23:29:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 797 ms / 2,000 ms |
コード長 | 1,363 bytes |
コンパイル時間 | 256 ms |
コンパイル使用メモリ | 82,456 KB |
実行使用メモリ | 145,268 KB |
最終ジャッジ日時 | 2024-12-21 04:06:40 |
合計ジャッジ時間 | 34,842 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 46 |
ソースコード
# test case 00 RE出る、なんでだろうねT = int(input())for t in range(T):N, M = map(int, input().split())A_list = list(map(int, input().split()))B_list = list(map(int, input().split()))A_set = set(A_list)B_set = set(B_list)A_solo = []double = []for a in A_list:if a in B_set:double.append(a)else:A_solo.append(a)B_solo = []for b in B_list:if b not in A_set:B_solo.append(b)#print(A_solo, double, B_solo)if N == 0 and M > 0:print('Yes')for b in B_list:print('Blue', b)elif N > 0 and M == 0:print('Yes')for a in A_list:print('Red', a)else:if len(double) == 0:print('No')else:print('Yes')double = sorted(list(double))for a in A_solo:print('Red', a)print('Red', double[0])print('Blue', double[0])for b in B_solo:print('Blue', b)for i in range(1, len(double)):if i%2 == 1:print('Blue', double[i])print('Red', double[i])else:print('Red', double[i])print('Blue', double[i])