結果

問題 No.420 mod2漸化式
ユーザー okayunonaha
提出日時 2016-09-18 03:37:02
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 461 bytes
コンパイル時間 607 ms
コンパイル使用メモリ 56,088 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-24 13:01:38
合計ジャッジ時間 1,676 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 34 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long ll;
#define int ll

// start
int comb[35][35];

int C(int n, int k) {
  if(n < k) return 0;
  if(comb[n][k]) return comb[n][k];
  else if(n == k || !k) return comb[n][k] = 1;
  return comb[n][k] = C(n-1, k) + C(n-1, k-1);
}
//end

signed main(void) {
  int x, Count, nsum;
  cin >> x;
  Count = C(31, x);
  if(x!=0) nsum = C(30, x-1) * 2147483647;
  cout << Count << " " << nsum << endl;
  return 0;
}
0