結果

問題 No.2853 A + B Problem
ユーザー w0t0w0t0
提出日時 2024-08-25 15:38:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 933 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 201,368 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-08-25 15:38:12
合計ジャッジ時間 3,568 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 3 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
//#include <atcoder/all>
//using namespace atcoder;
//using mint = modint998244353;
using namespace std;
using ll= long long;
using ull=unsigned long long;
using ldo =long double;
#define rep(i,n,k) for(ll i = k; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF = 1e18;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;

ull fa(ull x,ull y){
    ull sum = 1;
    rep(i,y,0){
        sum*=x;
        x--;
    }
    return sum;
}

int main(){
    ull N,B,ans=0,co,z;
    cin>>N;
    bitset<61> bs(N);
    //cout << bs.count() << endl;
    co=bs.count();
    rep(i,co,1){
        if(co-i<i)z=co-i;
        else z=i;
        //cout<<fa(co,co-i)<<" "<<fa(co-i,co-i)<<endl;
        ans+=fa(co,co-z)/fa(co-z,co-z);
    }
    cout<<ans<<endl;
}
0