結果

問題 No.420 mod2漸化式
ユーザー DaYuanChi
提出日時 2021-01-26 23:53:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 473 bytes
コンパイル時間 1,677 ms
コンパイル使用メモリ 167,016 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 21:52:44
合計ジャッジ時間 3,166 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 34 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ll C(int m, int n){
  ll now = 1;
  for(int i = 0; i < n; i++){
    now = (now*(m-i))/(i+1);
  }
  return now;
}

int main(){
  int x; cin >> x;
  if(x>31){
    cout << 0 << " " << 0 << endl;
    return 0;
  }else{
    ll ans1 = C(31, x);
    ll ans2 = 0;
    for(int i = 0; i <= 30; i++) ans2 += pow(2,i);
    ans2 *= C(30, x-1);
    cout << ans1 << " " << ans2 << endl;
    return 0;
  }
}
    
    
  
0