結果

問題 No.398 ハーフパイプ(2)
ユーザー pekempeypekempey
提出日時 2016-07-15 22:52:59
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 602 bytes
コンパイル時間 2,186 ms
コンパイル使用メモリ 144,408 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 22:01:13
合計ジャッジ時間 5,648 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
4,376 KB
testcase_01 AC 161 ms
4,376 KB
testcase_02 AC 161 ms
4,376 KB
testcase_03 AC 161 ms
4,376 KB
testcase_04 AC 161 ms
4,376 KB
testcase_05 AC 161 ms
4,376 KB
testcase_06 AC 161 ms
4,380 KB
testcase_07 AC 161 ms
4,376 KB
testcase_08 AC 161 ms
4,380 KB
testcase_09 AC 161 ms
4,376 KB
testcase_10 AC 161 ms
4,380 KB
testcase_11 AC 161 ms
4,376 KB
testcase_12 AC 161 ms
4,376 KB
testcase_13 AC 161 ms
4,376 KB
testcase_14 AC 160 ms
4,380 KB
testcase_15 AC 161 ms
4,380 KB
testcase_16 AC 161 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
	double X;
	cin >> X;

	int sum = round(X * 4);

	static long long dp[1 << 6][444];
	dp[0][0] = 1;

	for (int v = 0; v <= 100; v++) {
		for (int i = (1 << 6) - 1; i >= 0; i--) {
			for (int j = 0; j <= 400; j++) {
				int s = ((1 << 6) - 1) ^ i;
				for (int k = s; k != 0; k = (k - 1) & s) {
					int ni = i | k;
					int nj = j + v * __builtin_popcount(k);
					if (ni == (1 << 6) - 1) nj -= v;
					if (i == 0) nj -= v;
					if (nj <= 400) {
						dp[ni][nj] += dp[i][j];
					}
				}
			}
		}
	}

	cout << dp[(1 << 6) - 1][sum] << endl;
}
0