結果

問題 No.420 mod2漸化式
ユーザー k
提出日時 2020-07-02 02:23:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 1,673 ms
コンパイル使用メモリ 192,556 KB
最終ジャッジ日時 2025-01-11 13:54:55
ジャッジサーバーID
(参考情報)
judge5 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 34 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i=0; i<(int)(n); i++)

int comb[32][32];

void init() {
  REP (i, 32) {
    comb[i][0] = comb[i][i] = 1;
    for (int j = 1; j < i; j++)
      comb[i][j] = comb[i-1][j-1] + comb[i-1][j];
  }
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  init();

  int x;
  cin >> x;

  if (x < 1 || 31 < x)
    cout << 0 << " " << 0 << endl;
  else {
    int y = comb[31][x];
    long long z = 0;
    for (int i = 0; i < 31; i++)
      z += (1LL << i) * comb[30][x-1];
    cout << y << " " << z << endl;
  }
  
  return 0;
}
0