結果
問題 | No.398 ハーフパイプ(2) |
ユーザー | りあん |
提出日時 | 2016-07-14 16:26:23 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 366 ms / 2,000 ms |
コード長 | 921 bytes |
コンパイル時間 | 1,689 ms |
コンパイル使用メモリ | 165,388 KB |
実行使用メモリ | 163,952 KB |
最終ジャッジ日時 | 2023-09-09 21:53:09 |
合計ジャッジ時間 | 8,221 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 134 ms
128,728 KB |
testcase_01 | AC | 364 ms
163,768 KB |
testcase_02 | AC | 329 ms
159,100 KB |
testcase_03 | AC | 334 ms
159,436 KB |
testcase_04 | AC | 330 ms
159,228 KB |
testcase_05 | AC | 361 ms
163,256 KB |
testcase_06 | AC | 217 ms
144,664 KB |
testcase_07 | AC | 274 ms
152,824 KB |
testcase_08 | AC | 366 ms
163,952 KB |
testcase_09 | AC | 364 ms
163,008 KB |
testcase_10 | AC | 365 ms
163,164 KB |
testcase_11 | AC | 365 ms
163,308 KB |
testcase_12 | AC | 356 ms
162,340 KB |
testcase_13 | AC | 358 ms
162,364 KB |
testcase_14 | AC | 354 ms
162,032 KB |
testcase_15 | AC | 360 ms
163,648 KB |
testcase_16 | AC | 355 ms
162,364 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; long long dp[6][101][101][601]; int main() { double x; cin >> x; int sum = (int)(x * 4 + 1e-9); long long ans = 0; int lim = sum + 200; for (int i = 0; i < 101; ++i) { dp[0][i][i][i] = 1; } for (int i = 1; i < 6; i++) { for (int j = 0; j < 101; j++) { for (int k = j; k < 101; k++) { for (int l = j * i; l <= lim; ++l) { if (dp[i - 1][j][k][l] == 0) continue; for (int m = 0; m < 101 && l + m <= lim; ++m) { dp[i][min(j, m)][max(k, m)][l + m] += dp[i - 1][j][k][l]; } } } } } for (int i = 0; i < 101; ++i) { for (int j = i; j < 101; ++j) { ans += dp[5][i][j][sum + i + j]; } } cout << ans << "\n"; return 0; }