結果

問題 No.287 場合の数
ユーザー 👑 kmjpkmjp
提出日時 2015-10-09 22:29:28
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 847 bytes
コンパイル時間 1,614 ms
コンパイル使用メモリ 159,404 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 23:49:10
合計ジャッジ時間 4,850 ms
ジャッジサーバーID
(参考情報)
judge6 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 2 ms
6,820 KB
testcase_02 AC 1 ms
6,816 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 1 ms
6,940 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 2 ms
6,944 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

ll dp[8][601];
int N;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	dp[0][0]=1;
	FOR(i,8) {
		FOR(j,6*N+1) FOR(x,N+1) if(j+x<=6*N) dp[i+1][j+x] += dp[i][j];
	}
	
	cout<<dp[8][6*N]<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}
0