結果

問題 No.3126 Dual Query Problem
ユーザー tkykwtnb
提出日時 2025-04-25 21:50:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 82,324 KB
実行使用メモリ 93,136 KB
最終ジャッジ日時 2025-04-25 21:51:06
合計ジャッジ時間 9,932 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 19 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N,Q=map(int,input().split())
X=[int(input()) for _ in range(N)]
D=defaultdict(int)
A=defaultdict(int)
Xcnt=0
for x in X:
    if x>0:Xcnt+=1
    D[x]+=1
if Xcnt>(Q-N+Xcnt)//2:exit(print("No"))
print("Yes")
cnt=0
i=0
while i<N:
    if X[i]==0:
        print(f"2 0");cnt+=1
    else:
        if A[X[i]]==0:
            print(f"1 {X[i]} {X[i]}");cnt+=1
        print(f"2 {X[i]}");cnt+=1
    i+=1
if cnt<Q:
    print(f"1 1 1")
    cnt+=1
0