結果

問題 No.3126 Dual Query Problem
ユーザー tkykwtnb
提出日時 2025-04-25 22:15:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 82,132 KB
実行使用メモリ 93,396 KB
最終ジャッジ日時 2025-06-20 02:45:50
合計ジャッジ時間 12,161 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

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