結果

問題 No.690 E869120 and Constructing Array 4
ユーザー 夕叢霧香(ゆうむらきりか)
提出日時 2018-05-18 23:58:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 6 ms / 1,000 ms
コード長 517 bytes
コンパイル時間 691 ms
コンパイル使用メモリ 76,508 KB
最終ジャッジ日時 2025-01-05 10:40:56
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<algorithm>
#include<iostream>
#include<vector>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)

int main(){
  lint k;
  cin>>k;
  int n=32;
  vector<pii>e;
  rep(i,n){
    rep(j,i){
      if(j>0)
	e.push_back(pii(j,i));
    }
  }
  for(int i=n-3;i>=0;--i){
    if(k&1LL<<i)
      e.push_back(pii(0,n-i-2));
  }
  cout<<n<<" "<<e.size()<<endl;
  rep(i,e.size()){
    cout<<e[i].first+1<<" "<<e[i].second+1<<endl;
  }
}
0