結果
問題 |
No.420 mod2漸化式
|
ユーザー |
![]() |
提出日時 | 2018-07-30 12:27:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 377 bytes |
コンパイル時間 | 1,766 ms |
コンパイル使用メモリ | 167,164 KB |
実行使用メモリ | 13,756 KB |
最終ジャッジ日時 | 2024-09-13 15:57:02 |
合計ジャッジ時間 | 4,431 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | TLE * 1 -- * 34 |
ソースコード
#include<bits/stdc++.h> using namespace std; using Int = long long; //INSERT ABOVE HERE Int next_combination(Int sub) { Int x = sub & -sub, y = sub + x; return (((sub & ~y) / x) >> 1) | y; } signed main(){ Int n=31,k; cin>>k; Int cnt=0,ans=0; for(Int bit=(1LL<<k)-1;bit<(1LL<<n);bit=next_combination(bit)) cnt++,ans+=bit; cout<<cnt<<" "<<ans<<endl; return 0; }