結果
| 問題 |
No.3126 Dual Query Problem
|
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2025-04-25 21:34:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 310 ms / 2,000 ms |
| コード長 | 392 bytes |
| コンパイル時間 | 322 ms |
| コンパイル使用メモリ | 82,456 KB |
| 実行使用メモリ | 134,576 KB |
| 最終ジャッジ日時 | 2025-06-20 02:40:35 |
| 合計ジャッジ時間 | 14,368 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
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]))
while len(ans) < Q:
ans.append((1, 1, 1))
print("Yes")
for a in ans:
print(*a)
detteiuu