結果

問題 No.23 技の選択
ユーザー imulan
提出日時 2015-12-16 11:32:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 410 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 56,568 KB
実行使用メモリ 10,020 KB
最終ジャッジ日時 2024-09-16 05:39:46
合計ジャッジ時間 7,005 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 TLE * 1 -- * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;

int h,a,d;
double dp[10001];

//damage分のダメージを与えるために必要な攻撃回数の期待値の最小
double rec(int damage){
  if(damage >= h) return 0;
  return min( rec(damage+a)+1, rec(damage+d)+1.5  );
}

int main(int argc, char const *argv[]) {
  cin >>h >>a >>d;
  printf("%lf\n", rec(0));
  return 0;
}
0