結果
問題 |
No.3126 Dual Query Problem
|
ユーザー |
![]() |
提出日時 | 2025-04-25 21:43:47 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 222 ms / 2,000 ms |
コード長 | 1,678 bytes |
コンパイル時間 | 3,773 ms |
コンパイル使用メモリ | 283,892 KB |
実行使用メモリ | 8,356 KB |
最終ジャッジ日時 | 2025-06-20 02:42:43 |
合計ジャッジ時間 | 15,654 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> //#include <atcoder/all> using namespace std; //using namespace atcoder; using lli=long long int; using ld=long double; using vi=vector<int>; using vvi=vector<vi>; using vvvi=vector<vvi>; using vvvvi=vector<vvvi>; using vl=vector<lli>; using vvl=vector<vl>; #define rep(i,s,e) for(lli i=s;i<e;i++) #define rrep(i,s,e) for(lli i=s-1;i>=e;i--) #define in(v,seq) for(auto v:seq) #define veci(v,s) vi v(s); rep(i,0,s) cin >> v.at(i); #define vecl(v,s) vl v(s); rep(i,0,s) cin >> v.at(i); #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() using pii=pair<int,int>; using pll=pair<lli,lli>; #define mp(f,s) make_pair(f,s) #define fi first #define se second using vpii=vector<pii>; using vpll=vector<pll>; #define vecpii(v,s) vpii v(s); rep(i,0,s) cin >> v.at(i).fi >> v.at(i).se; #define vecpll(v,s) vpll v(s); rep(i,0,s) cin >> v.at(i).fi >> v.at(i).se; #define pub(x) push_back(x) #define puf(x) push_front(x) #define pob(x) pop_back(x) #define pof(x) pop_front(x) #define eb(x) emplace_back(x) #define print(s) cout << s << endl; const int I_INF=1<<30; const lli LL_INF=1ll<<60; const string alp="abcdefghijklmnopqrstuvwxyz"; const int let=alp.size(); // 26; int main(){ int n,q; cin >> n >> q; veci(x,n); map<int,int> m; in(v,x){ if(!m.count(v)){ m[v]=-1; } } if(m.size()+n>q){ print("No"); return 0; } print("Yes"); int ind=0,a=1; rep(i,0,q){ if(ind<n){ if(m[x[ind]]==-1){ m[x[ind]]=a; printf("%d %d %d\n",1,a,x[ind]); a++; }else{ printf("%d %d\n",2,m[x[ind]]); ind++; } }else{ printf("%d %d %d\n",1,1,10); } } }