結果

問題 No.420 mod2漸化式
ユーザー chakkuchakku
提出日時 2016-09-09 23:01:18
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,220 bytes
コンパイル時間 1,313 ms
コンパイル使用メモリ 158,204 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-28 02:32:14
合計ジャッジ時間 2,084 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 WA -
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
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 -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 1 ms
6,944 KB
testcase_34 AC 2 ms
6,940 KB
testcase_35 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

// use 31 bit

int main(){
    //cout << (1ll<<31) -1 << endl;
    ll x;cin>>x;

    if(x>31){
        cout << "0 0" << endl;
        return 0;
    }


    ll ans1=1;
    ll r = min(x,(ll)31-x);
    for(int i=0;i<r;i++){
        ans1 *= (31-i);
    }
    for(int i=1;i<=r;i++){
        ans1 /= i;
    }
    cout << ans1 << " ";

    ll t=1;
    for(int i=0;i<r;i++){
        t *= (30-i);
    }
    for(int i=1;i<=r;i++){
        t /= i;
    }

    ll tt=ans1-t;
    ll ans2=0;
    for(int i=0;i<31;i++){
        ans2 += (1<<i) * tt;
    }
    cout << ans2 << endl;
}
0