結果

問題 No.398 ハーフパイプ(2)
ユーザー koyumeishikoyumeishi
提出日時 2015-10-28 00:37:26
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,195 ms / 2,000 ms
コード長 1,067 bytes
コンパイル時間 667 ms
コンパイル使用メモリ 76,244 KB
実行使用メモリ 92,072 KB
最終ジャッジ日時 2023-09-09 21:44:20
合計ジャッジ時間 18,986 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 857 ms
91,864 KB
testcase_01 AC 856 ms
91,964 KB
testcase_02 AC 1,028 ms
91,924 KB
testcase_03 AC 1,167 ms
91,812 KB
testcase_04 AC 1,195 ms
92,072 KB
testcase_05 AC 1,122 ms
91,900 KB
testcase_06 AC 833 ms
91,988 KB
testcase_07 AC 861 ms
91,800 KB
testcase_08 AC 849 ms
91,964 KB
testcase_09 AC 840 ms
91,808 KB
testcase_10 AC 848 ms
91,912 KB
testcase_11 AC 846 ms
91,924 KB
testcase_12 AC 852 ms
92,004 KB
testcase_13 AC 843 ms
91,852 KB
testcase_14 AC 841 ms
91,812 KB
testcase_15 AC 848 ms
91,924 KB
testcase_16 AC 837 ms
92,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstdio>
#include <map>
#include <algorithm>
#include <functional>
#include <cassert>
using namespace std;

#define SZ 101
#define NUM 6

int main(){
	vector<vector<vector<long long>>> dp(SZ,vector<vector<long long>>(SZ,vector<long long>(100+1, 0)));	//dp[min][max][sum]

	for(int i=0; i<SZ; i++){
		dp[i][i][i] = 1;
	}
	for(int i=1; i<NUM; i++){
		vector<vector<vector<long long>>> dp_(SZ,vector<vector<long long>>(SZ,vector<long long>((i+1)*100+1, 0)));

		for(int k=0; k<SZ; k++)
		for(int min_=0;    min_<SZ; ++min_)
		for(int max_=min_; max_<SZ; ++max_)
		for(int sum=0; sum<=i*100; ++sum){
			dp_[min(min_,k)][max(max_,k)][sum+k] += dp[min_][max_][sum];	
		}
		swap(dp, dp_);
	}

	vector<long long> m(401, 0);
	for(int min_=0;    min_<SZ; ++min_)
	for(int max_=min_; max_<SZ; ++max_)
	for(int sum=0; sum<=600; ++sum){
		if(dp[min_][max_][sum] > 0)
			m[sum-(min_+max_)] += dp[min_][max_][sum];
	}

	int a,b;
	scanf("%d.%d", &a,&b);
	a = (a*100+b)/25;

	printf("%lld\n", m[a]);
	//cout << m[a] << endl;
	return 0;
}
0