結果

問題 No.398 ハーフパイプ(2)
ユーザー antaanta
提出日時 2016-07-15 22:42:06
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 285 ms / 2,000 ms
コード長 1,221 bytes
コンパイル時間 1,640 ms
コンパイル使用メモリ 169,828 KB
実行使用メモリ 51,340 KB
最終ジャッジ日時 2023-09-09 21:58:34
合計ジャッジ時間 7,276 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 278 ms
51,148 KB
testcase_01 AC 275 ms
51,272 KB
testcase_02 AC 281 ms
51,172 KB
testcase_03 AC 278 ms
51,196 KB
testcase_04 AC 276 ms
51,196 KB
testcase_05 AC 275 ms
51,172 KB
testcase_06 AC 276 ms
51,200 KB
testcase_07 AC 280 ms
51,168 KB
testcase_08 AC 280 ms
51,288 KB
testcase_09 AC 277 ms
51,340 KB
testcase_10 AC 279 ms
51,268 KB
testcase_11 AC 282 ms
51,144 KB
testcase_12 AC 277 ms
51,196 KB
testcase_13 AC 280 ms
51,192 KB
testcase_14 AC 279 ms
51,296 KB
testcase_15 AC 279 ms
51,176 KB
testcase_16 AC 285 ms
51,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if(x < y) x = y; }


int main() {
	double Xx;
	while(cin >> Xx) {
		int X = (int)(Xx * 100 + .5);
		ll ans = 0;
		if(X % 25 != 0) {
			ans = 0;
		} else {
			int sum = X * 4 / 100;
			vector<vector<ll>> dp(601, vector<ll>(101 * 101));
			dp[0][100 * 101 + 0] = 1;
			rep(k, 6) {
				for(int j = k * 100; j >= 0; -- j) rer(mi, 0, 100) rer(ma, 0, 100) {
					ll x = dp[j][mi * 101 + ma];
					if(x == 0) continue;
					dp[j][mi * 101 + ma] = 0;
					rer(a, 0, 100)
						dp[j + a][min(mi, a) * 101 + max(ma, a)] += x;
				}
			}
			rer(mi, 0, 100) rer(ma, 0, 100) {
				ans += dp[sum + mi + ma][mi * 101 + ma];
			}
		}
		printf("%lld\n", ans);
	}
	return 0;
}
0