結果

問題 No.287 場合の数
ユーザー Kei
提出日時 2025-05-01 22:27:31
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 479 bytes
コンパイル時間 3,482 ms
コンパイル使用メモリ 223,984 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-05-01 22:27:36
合計ジャッジ時間 4,152 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<atcoder/convolution>
using namespace std;
using namespace atcoder;
int main() {
  int n;
  cin >> n;
  vector<long long> f(n + 1, 1);

  int N = 6;
  vector<long long> res = {1};
  while (N > 0) {
    if (N % 2 == 1) {
      res = convolution_ll(res, f);
      if (res.size() > 6 * n + 1) res.resize(6 * n + 1);
    }
    f = convolution_ll(f, f);
    if (f.size() > 6 * n + 1) f.resize(6 * n + 1);
    N /= 2;
  }
  cout << f[6 * n] << endl;
}
0