結果

問題 No.287 場合の数
ユーザー airis
提出日時 2015-10-10 17:04:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 977 bytes
コンパイル時間 792 ms
コンパイル使用メモリ 80,004 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 23:59:37
合計ジャッジ時間 1,484 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <numeric>
#include <bitset>
#include <complex>
#define rep(x, to) for (int x = 0; x < (to); x++)
#define REP(x, a, to) for (int x = (a); x < (to); x++)
#define foreach(itr, x) for (typeof((x).begin()) itr = (x).begin(); itr != (x).end(); itr++)
#define EPS (1e-14)

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef complex<double> Complex;
typedef vector< vector<int> > Mat;

ll ans;
ll n;
ll dp[10][605];

void solve() {
	dp[0][0] = 1;
	for (int i = 0; i < 8; i++) {
		for (int j = 0; j <= 6 * n; j++) {
			for (int k = 0; k <= n; k++) {
				if (j - k < 0) continue;
				dp[i + 1][j] += dp[i][j - k];
			}
		}
	}
	cout << dp[8][6 * n] << endl;
}

int main() {
	cin >> n;
	solve();
	return 0;
}


0