結果

問題 No.398 ハーフパイプ(2)
ユーザー femtofemto
提出日時 2016-07-16 00:53:53
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 439 ms / 2,000 ms
コード長 812 bytes
コンパイル時間 1,579 ms
コンパイル使用メモリ 67,332 KB
実行使用メモリ 143,296 KB
最終ジャッジ日時 2023-09-09 22:07:12
合計ジャッジ時間 9,278 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 437 ms
143,072 KB
testcase_01 AC 434 ms
143,144 KB
testcase_02 AC 434 ms
143,144 KB
testcase_03 AC 435 ms
143,056 KB
testcase_04 AC 434 ms
143,140 KB
testcase_05 AC 430 ms
143,072 KB
testcase_06 AC 430 ms
143,208 KB
testcase_07 AC 433 ms
143,144 KB
testcase_08 AC 430 ms
143,040 KB
testcase_09 AC 431 ms
143,052 KB
testcase_10 AC 429 ms
143,048 KB
testcase_11 AC 433 ms
143,296 KB
testcase_12 AC 439 ms
143,140 KB
testcase_13 AC 437 ms
143,140 KB
testcase_14 AC 435 ms
143,144 KB
testcase_15 AC 433 ms
143,136 KB
testcase_16 AC 431 ms
143,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;

typedef long long ll;
ll dp[7][110][110][610];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	double X;
	cin >> X;
	X *= 4;

	dp[0][100][0][0] = 1;
	for(int i = 0; i < 6; i++) {
		for(int j = 0; j <= 100; j++) {
			for(int k = 0; k <= 100; k++) {
				for(int l = 0; l <= 600; l++) {
					if(dp[i][j][k][l] == 0) continue;
					for(int m = 0; m <= 100; m++) {
						dp[i + 1][min(j, m)][max(k, m)][l + m] += dp[i][j][k][l];
					}
				}
			}
		}
	}

	ll ans = 0;
	for(int j = 0; j <= 100; j++) {
		for(int k = 0; k <= 100; k++) {
			for(int l = 0; l <= 600; l++) {
				if(l - j - k == (int)X) {
					ans += dp[6][j][k][l];
				}
			}
		}
	}
	cout << ans << endl;
}
0