結果

問題 No.3126 Dual Query Problem
ユーザー リテモス
提出日時 2025-04-25 23:18:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 788 bytes
コンパイル時間 4,373 ms
コンパイル使用メモリ 256,428 KB
実行使用メモリ 8,324 KB
最終ジャッジ日時 2025-04-25 23:19:19
合計ジャッジ時間 18,762 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint998244353;

#define rep(i, n) for (int i = 0; i < (n); ++i)

int main() {

  int n,q; cin >> n >> q;
  vector<int> a;
  map<int,int> mp;
  int cnt = 1;
  rep (i,n) {
    int num; cin >> num;
    a.push_back(num);
    if (mp.count(num)) continue;
    else mp[num] = cnt;
    cnt++;
  }

  if (mp.size()*2 > q){
    cout << "No\n";
    return 0;
  }

  cnt = 0;

  cout << "Yes\n";
  for (auto p : mp){
    cnt++;
    cout << 1 << " " << p.second << " " << p.first << "\n";
  }

  while(cnt < q-a.size()){
    cnt++;
    cout << 1 << " " << cnt << " " << 100 << "\n";
  }

  for (auto num : a){
    cout << 2 << " " << mp[num] << "\n";
  }

  return 0;
}
0