結果

問題 No.287 場合の数
ユーザー Maple_LandscapeMaple_Landscape
提出日時 2015-10-09 23:38:08
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 571 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 56,680 KB
実行使用メモリ 10,012 KB
最終ジャッジ日時 2024-04-19 23:50:54
合計ジャッジ時間 12,818 ms
ジャッジサーバーID
(参考情報)
judge6 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    3 | main(){
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
main(){
	int a,b,c,d,e,f,g,h,n,n6,G=0;
	
	cin >> n;
	
	n6 = n*6;
	
	for(a=0;a<=n;++a){
		for(b=0;b<=n;++b){
			for(c=0;c<=n;++c){
				if(a+b+c<n)continue;
				for(d=0;d<=n;++d){
					if(a+b+c+d<2*n)continue;
					for(e=0;e<=n;++e){
						if(a+b+c+d+e<3*n)continue;
						for(f=0;f<=n;++f){
							if(a+b+c+d+e+f<4*n)continue;
							for(g=0;g<=n;++g){
								if(a+b+c+d+e+f+g>n6)continue;
								for(h=0;h<=n;++h){
									if(a+b+c+d+e+f+g+h==n6)++G;
								}
							}
						}
					}
				}
			}
		}
	}
	
	cout << G << endl;
	
}
0