結果

問題 No.398 ハーフパイプ(2)
ユーザー simansiman
提出日時 2022-01-06 03:34:43
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 891 bytes
コンパイル時間 1,099 ms
コンパイル使用メモリ 138,604 KB
実行使用メモリ 338,944 KB
最終ジャッジ日時 2024-04-24 08:44:16
合計ジャッジ時間 20,290 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cassert>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <climits>
#include <map>
#include <queue>
#include <set>
#include <cstring>
#include <vector>

using namespace std;
typedef long long ll;

ll memo[7][601][101][101];
double X;

ll dfs(int i, int score, int mi, int ma) {
  if (memo[i][score][mi][ma] != -1) {
    return memo[i][score][mi][ma];
  }
  ll res = 0;

  if (i == 6) {
    int r = score - (mi + ma);
    if (100 * X == 25 * r) {
      // fprintf(stderr, "score: %d, mi: %d, ma: %d\n", score, mi, ma);
      res = 1LL;
    } else {
      res = 0LL;
    }
  } else {
    for (int s = 0; s <= 100; ++s) {
      res += dfs(i + 1, score + s, min(mi, s), max(ma, s));
    }
  }

  return memo[i][score][mi][ma] = res;
}

int main() {
  memset(memo, -1, sizeof(memo));
  cin >> X;

  cout << dfs(0, 0, 100, 0) << endl;

  return 0;
}
0