結果
問題 |
No.287 場合の数
|
ユーザー |
![]() |
提出日時 | 2019-07-06 23:54:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 1,014 bytes |
コンパイル時間 | 1,319 ms |
コンパイル使用メモリ | 96,316 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-01 19:30:51 |
合計ジャッジ時間 | 2,220 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }