結果

問題 No.3126 Dual Query Problem
ユーザー ルク
提出日時 2025-03-21 15:35:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 292 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 804 ms
コンパイル使用メモリ 81,516 KB
実行使用メモリ 95,640 KB
最終ジャッジ日時 2025-06-20 02:28:13
合計ジャッジ時間 14,086 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

n,q=map(int,input().split())
items=[int(input()) for _ in range(n)]
st=set(items)
mp=defaultdict(int)
res=0
if len(st)+n<=q:
    print("Yes")
    for i in range(n):
        if items[i] not in mp:
            mp[items[i]]=len(mp)+1
            print(1,len(mp),items[i])
            res+=1
        print(2,mp[items[i]])
        res+=1
    for i in range(q-res):
        print(1,10**8,10**8)
else:
    print("No")
0