結果
| 問題 | No.3126 Dual Query Problem |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-25 22:15:09 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 173 ms / 2,000 ms |
| + 900µs | |
| コード長 | 389 bytes |
| 記録 | |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 96,044 KB |
| 実行使用メモリ | 100,300 KB |
| 最終ジャッジ日時 | 2026-07-12 11:17:48 |
| 合計ジャッジ時間 | 12,075 ms |
|
ジャッジサーバーID (参考情報) |
judge1_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)]
A=defaultdict(int)
st=set()
for x in X:
st.add(x)
if len(st)+N>Q:
exit(print("No"))
print("Yes")
cnt=0
i=0
while i<N:
if A[X[i]]==0:
print(f"1 {X[i]} {X[i]}");cnt+=1
A[X[i]]=X[i]
print(f"2 {X[i]}");cnt+=1
i+=1
while cnt<Q:
print(f"1 1 1")
cnt+=1