結果

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

ソースコード

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;
  rep(i,n){
    int num; cin >> num;
    a.push_back(num);
    if (mp.count(num)) continue;
    else mp[num] = i+1;
  }

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

  int cnt = 0;

  for (auto p : mp){
    cnt++;
    cout << 1 << " " << cnt << " " << 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