結果

問題 No.3126 Dual Query Problem
ユーザー a01sa01to
提出日時 2025-04-28 00:23:52
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 882 bytes
コンパイル時間 3,962 ms
コンパイル使用メモリ 289,384 KB
実行使用メモリ 12,928 KB
最終ジャッジ日時 2025-04-28 00:24:08
合計ジャッジ時間 14,303 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 21 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  int n, q;
  cin >> n >> q;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  int cnt = 0;
  set<int> st;
  st.insert(0);
  rep(i, n) {
    if (!st.contains(a[i])) ++cnt, st.insert(a[i]);
    ++cnt;
  }
  if (cnt > q) {
    cout << "No" << '\n';
    return 0;
  }
  cout << "Yes" << '\n';
  st.erase(0);
  map<int, int> mp;
  int idx = 0;
  for (int x : st) mp[x] = idx++;
  for (auto [k, v] : mp) cout << 1 << ' ' << v + 1 << ' ' << k << '\n';
  mp[0] = idx++;
  rep(i, n) cout << 2 << ' ' << mp[a[i]] + 1 << '\n';
  rep(_, q - cnt) cout << 1 << ' ' << 1 << ' ' << 0 << '\n';
  return 0;
}
0