結果

問題 No.3126 Dual Query Problem
ユーザー detteiuu
提出日時 2025-04-25 21:32:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 82,640 KB
実行使用メモリ 134,768 KB
最終ジャッジ日時 2025-04-25 21:33:07
合計ジャッジ時間 14,510 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 21 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N, Q = map(int, input().split())
X = [int(input()) for _ in range(N)]

sX = list(set(X))
if Q < N+len(sX):
    exit(print("No"))

D = defaultdict(int)
ans = []
for i, x in enumerate(sX):
    ans.append((1, i+1, x))
    D[x] = i+1
for x in X:
    ans.append((2, D[x]))

print("Yes")
for a in ans:
    print(*a)
0