結果

問題 No.690 E869120 and Constructing Array 4
ユーザー ei1333333
提出日時 2018-05-18 23:45:08
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 435 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 197,680 KB
最終ジャッジ日時 2025-01-05 10:40:14
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;


int main() {
  int K;
  cin >> K;
  vector< int > s(32);
  s[0] = 1;
  vector< pair< int, int > > es;
  for(int i = 1; i < 32; i++) {
    for(int j = i - 1; j >= 0; j--) {
      if(s[i] + s[j] <= K) {
        s[i] += s[j];
        es.emplace_back(j, i);
      }
    }
  }
  cout << 32 << " " << es.size() << endl;
  for(auto &p : es) cout << p.first + 1 << " " << p.second + 1 << endl;
}
0