結果
| 問題 |
No.23 技の選択
|
| コンテスト | |
| ユーザー |
ふーらくたる
|
| 提出日時 | 2016-06-27 11:14:47 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 446 bytes |
| コンパイル時間 | 454 ms |
| コンパイル使用メモリ | 54,964 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-11 22:22:28 |
| 合計ジャッジ時間 | 3,307 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 RE * 14 |
ソースコード
#include <iostream>
using namespace std;
const int kMAX_H = 10010;
int H, A, D;
double memo[kMAX_H];
double E(int x) {
if (memo[x] >= 0) return memo[x];
if (x >= H) return memo[x] = 0.0;
double res;
res = min(E(x + A) + 1.0, E(x + D) + 3.0 / 2.0);
return memo[x] = res;
}
void Solve() {
fill(memo, memo + kMAX_H, -1.0);
cout << E(0) << endl;
}
int main() {
cin >> H >> A >> D;
Solve();
return 0;
}
ふーらくたる