結果
問題 | No.690 E869120 and Constructing Array 4 |
ユーザー |
![]() |
提出日時 | 2018-05-18 22:35:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 629 bytes |
コンパイル時間 | 1,580 ms |
コンパイル使用メモリ | 174,620 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-28 13:52:54 |
合計ジャッジ時間 | 2,549 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
#include<bits/stdc++.h> using namespace std; using Int = long long; //INSERT ABOVE HERE signed main(){ Int w; cin>>w; const Int n=32; using P = pair<Int, Int>; vector<vector<P> > G(n); Int s=0,t=n-1,m=0; for(Int i=1;i<t;i++) for(Int j=i+1;j<t;j++) G[i].emplace_back(j,j-i),m++; for(Int i=1;i<t;i++) G[s].emplace_back(i,i),m++; for(Int i=1;i<t;i++){ if(w&1) G[i].emplace_back(t,1000-i),m++; w>>=1; } cout<<n<<" "<<m<<endl; for(Int i=0;i<n;i++){ for(auto p:G[i]){ Int u=i,v=p.first; if(u>v) swap(u,v); cout<<u+1<<" "<<v+1<<endl; } } return 0; }