結果
問題 | No.2853 A + B Problem |
ユーザー |
![]() |
提出日時 | 2024-08-25 15:02:28 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 561 bytes |
コンパイル時間 | 1,173 ms |
コンパイル使用メモリ | 158,596 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-08-25 15:02:32 |
合計ジャッジ時間 | 2,019 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long int ll;typedef pair<ll,ll> pll;typedef vector<ll> vll;#define repi(i,a,b) for(ll i=a;i<b;i++)#define rep(i,a) repi(i,0,a)#define rrep(i,a) for(ll i=a-1;i>=0;i--)#define MOD 1000000007//debug#define debug(arr) cerr<<#arr<<"(l"<<__LINE__<<") : ";for(auto x:arr)cerr<<x<<" ";cerr<<endl;int main(){ll N;cin >> N;ll n_tmp = N;ll bcnt = 0;while(n_tmp) {if(n_tmp % 2 == 1) bcnt++;n_tmp /= 2;}ll ans = (1LL << bcnt) - 2;cout << ans << endl;return 0;}