結果
問題 |
No.287 場合の数
|
ユーザー |
|
提出日時 | 2020-07-11 04:45:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 1,014 bytes |
コンパイル時間 | 952 ms |
コンパイル使用メモリ | 106,132 KB |
最終ジャッジ日時 | 2025-01-11 19:30:07 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <cstdio> #include <iostream> #include <string> #include <sstream> #include <stack> #include <algorithm> #include <cmath> #include <queue> #include <map> #include <set> #include <cstdlib> #include <bitset> #include <tuple> #include <assert.h> #include <fstream> template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const long long INF = 1LL << 60; const long long MOD = 1000000007LL; const long long MAX = 500000LL; using namespace std; typedef unsigned long long ull; typedef long long ll; ll N; vector<vector<ll>> dp; int main() { cin >> N; dp = vector<vector<ll>>(8, vector<ll>(6 * N + 1, 0)); for (ll i = 0; i <= N; i++) { dp[0][i] = 1; } for (ll i = 1; i < 8; i++) { for (ll j = 0; j <= 6 * N; j++) { for (ll k = 0; k <= N; k++) { if (j - k < 0) break; dp[i][j] += dp[i - 1][j - k]; } } } cout << dp[7][6 * N] << endl; return 0; }