結果
| 問題 | No.3126 Dual Query Problem |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2025-04-25 21:34:04 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 207 ms / 2,000 ms |
| + 280µs | |
| コード長 | 392 bytes |
| 記録 | |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 96,232 KB |
| 実行使用メモリ | 128,596 KB |
| 最終ジャッジ日時 | 2026-07-12 11:06:12 |
| 合計ジャッジ時間 | 12,486 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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