結果

問題 No.398 ハーフパイプ(2)
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2016-09-01 00:35:38
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,053 bytes
コンパイル時間 737 ms
コンパイル使用メモリ 60,888 KB
実行使用メモリ 153,264 KB
最終ジャッジ日時 2024-04-26 22:08:58
合計ジャッジ時間 6,443 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 282 ms
151,808 KB
testcase_01 AC 282 ms
151,808 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 282 ms
151,808 KB
testcase_06 AC 282 ms
151,808 KB
testcase_07 WA -
testcase_08 AC 283 ms
151,680 KB
testcase_09 AC 281 ms
151,680 KB
testcase_10 AC 287 ms
151,552 KB
testcase_11 AC 285 ms
151,936 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 285 ms
151,680 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
typedef long long ll;
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

//dp[i][j][k][l] := i番目まの審査員まで考えて(0origin)、
//最小値がj、最大値がkで合計がlの時の場合の数。
int dp[7][110][110][610];
int main(void){
	double x; cin >> x;
	
	rep(i, 6)rep(j, 101)rep(k, 101)rep(l, 601){
		dp[i][j][k][l] = 0;//場合の数0で初期化
	}
	rep(i, 101){
		dp[0][i][i][i] = 1;//0番目の審査員まで考えた時。
	}

	rep(i, 5)rep(j, 101)rep(k, 101)rep(l, 601){
		if(dp[i][j][k][l] == 0) continue;
		rep(now, 101){
			//配るdp
			if(now < j){
				dp[i + 1][now][k][l + now] += dp[i][j][k][l];
			}else if(k < now){
				dp[i + 1][j][now][l + now] += dp[i][j][k][l];
			}else{
				dp[i + 1][j][k][l + now]   += dp[i][j][k][l];
			}
		}
	}

	int ans = 0;
	rep(j, 101)rep(k, 101)rep(l, 601){
		double sum = l - j - k;
		if(sum == 4.0 * x){//(l - j - k) = 4 * x
			ans += dp[5][j][k][l];
		}
	}
	cout << ans << endl;
	return 0;
}
0