Created
October 9, 2015 18:14
-
-
Save ctylim/62a7414a0ec6bb962d5a to your computer and use it in GitHub Desktop.
yukicoder No.287
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
#include <vector> | |
#include <algorithm> | |
#include <numeric> | |
#include <functional> | |
#include <cmath> | |
#include <queue> | |
#include <stack> | |
#include <set> | |
#include <map> | |
#define repd(i,a,b) for (int i=(a);i<(b);i++) | |
#define rep(i,n) repd(i,0,n) | |
#define var auto | |
#define mod 1000000007 | |
typedef long long ll; | |
using namespace std; | |
int inputValue(){ | |
int a; | |
cin >> a; | |
return a; | |
} | |
template <typename T> | |
void output(T a, int precision) { | |
if(precision > 0){ | |
cout << fixed << setprecision(precision) << a << "\n"; | |
} | |
else{ | |
cout << a << "\n"; | |
} | |
} | |
// end of template | |
int main() { | |
// source code | |
int n = inputValue(); | |
vector<vector<ll>> dp(8, vector<ll>(6 * n + 1, 0)); | |
rep(i, n + 1){ | |
dp[0][i] = 1; | |
} | |
repd(i, 1, 8){ | |
rep(j, 6 * n + 1){ | |
rep(k, n + 1){ | |
if (j >= k) { | |
dp[i][j] += dp[i - 1][j - k]; | |
} | |
} | |
} | |
} | |
output(dp[7][6 * n], 0); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment