結果
問題 | No.23 技の選択 |
ユーザー |
![]() |
提出日時 | 2014-12-27 12:09:25 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 612 bytes |
コンパイル時間 | 565 ms |
コンパイル使用メモリ | 73,172 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 16:45:58 |
合計ジャッジ時間 | 1,544 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
ソースコード
#include <iostream> #include <cmath> #include <vector> #include <utility> #include <queue> #include <map> #include <string> #include <cstring> #include <list> #include <algorithm> #define INF 114514 using namespace std; typedef pair<double,double> P; typedef long long ll; int a,d; double memo[100001]; double dfs(int h){ if(h <= 0)return 0; if(memo[h] != -1)return memo[h]; return memo[h] = min(dfs(h-a) + 1 ,dfs(h-d) + 1.5); } int main(void) { int h; for(int i=0;i<100001;i++)memo[i] = -1; cin >> h >> a >> d; printf("%.10f\n",dfs(h)); } //command ctrl 上下 //command D //command caps G → '' ""