結果

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

ソースコード

diff #

import sys,collections
input = sys.stdin.readline
n,q = map(int,input().split())
x = [int(input()) for i in range(n)]
ans = []
c = collections.defaultdict(lambda :-1)
idx = 1
for i in x:
    if c[i] == -1:
        c[i] = idx
        ans.append([1,idx,i])
        idx+=1
    ans.append([2,c[i]])
if len(ans) > q:
    exit(print('No'))
while len(ans) < q:
    ans.append([1,1000000000,1000000000])
print('Yes')
for i in ans:
    print(*i)
0