結果
問題 |
No.3126 Dual Query Problem
|
ユーザー |
![]() |
提出日時 | 2025-04-25 22:07:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 476 ms / 2,000 ms |
コード長 | 452 bytes |
コンパイル時間 | 748 ms |
コンパイル使用メモリ | 11,904 KB |
実行使用メモリ | 32,744 KB |
最終ジャッジ日時 | 2025-06-20 02:45:33 |
合計ジャッジ時間 | 17,943 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import sys input = sys.stdin.readline from random import randint N,Q=map(int,input().split()) X=[int(input()) for i in range(N)] ANS=[] SET=set() for x in X: if x in SET: ANS.append((2,x)) else: ANS.append((1,x,x)) ANS.append((2,x)) SET.add(x) if len(ANS)>Q: print("No") else: while len(ANS)<Q: ANS.append((1,1,1)) print("Yes") for ans in ANS: print(*ans)