結果
| 問題 |
No.3126 Dual Query Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-25 22:11:34 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 386 bytes |
| コンパイル時間 | 249 ms |
| コンパイル使用メモリ | 81,868 KB |
| 実行使用メモリ | 93,444 KB |
| 最終ジャッジ日時 | 2025-04-25 22:12:09 |
| 合計ジャッジ時間 | 13,166 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 WA * 8 |
ソースコード
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
if cnt<Q:
print(f"1 1 1")
cnt+=1