結果

問題 No.3126 Dual Query Problem
ユーザー wingu
提出日時 2025-04-25 21:35:34
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 1,011 bytes
コンパイル時間 3,338 ms
コンパイル使用メモリ 281,612 KB
実行使用メモリ 8,228 KB
最終ジャッジ日時 2025-06-20 02:40:40
合計ジャッジ時間 13,095 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#ifdef local
#include <debug.hpp>
#else
#define debug(...)
#endif
#define rep(i, n) for (int i = 0; i < n; i++)
template <class T> istream& operator>>(istream& I, vector<T>& V) {for (T& X : V) I >> X; return I;}
template <class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
template <class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
vector<int> di = {-1, 1, 0, 0}, dj = {0, 0, -1, 1}; int inf = 1e9; long INF = 1e18;

int main() {
    int n, q;
    cin >> n >> q;
    vector<int> x(n);
    cin >> x;

    set<int> st(x.begin(), x.end());
    if (st.size() + n > q) {
        cout << "No\n";
        return 0;
    } else {
        cout << "Yes\n";
    }

    for (int a : st) {
        cout << 1 << " " << a << " " << a << '\n';
    }
    rep(i, (q - n) - st.size()) {
        cout << 1 << " " << "1 1\n";
    }

    rep(i, n) {
        cout << 2 << " " << x[i] << '\n';
    }
    return 0;
}
0