結果
| 問題 |
No.287 場合の数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-10 11:45:26 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 5,000 ms |
| コード長 | 575 bytes |
| コンパイル時間 | 529 ms |
| コンパイル使用メモリ | 72,160 KB |
| 最終ジャッジ日時 | 2025-01-14 09:14:20 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include <iostream>
#include <vector>
using lint = long long;
void solve() {
int n;
std::cin >> n;
std::vector<lint> dp(n * 6 + 1, 0);
dp[0] = 1;
for (int q = 0; q < 8; ++q) {
std::vector<lint> ndp(n * 6 + 1, 0);
for (int d = 0; d <= n; ++d) {
for (int x = n * 6; x >= d; --x) {
ndp[x] += dp[x - d];
}
}
std::swap(dp, ndp);
}
std::cout << dp.back() << "\n";
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}