結果
問題 |
No.23 技の選択
|
ユーザー |
![]() |
提出日時 | 2015-02-24 22:58:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 460 bytes |
コンパイル時間 | 526 ms |
コンパイル使用メモリ | 58,204 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 23:04:41 |
合計ジャッジ時間 | 5,470 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 RE * 29 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; double a[3010]; int main() { double* E=a+1001; int H, A, D; while (cin>>H>>A>>D) { fill(E, E+2000, 100000); E[0]=0; for(int i=0;i<=H;++i) { E[i+A]=min(E[i+A], E[i]+1); E[i+D]=min(E[i+D], E[i]+1.5); } double res=100000; for(int i=H;i<=H+max(A,D);++i) if (E[i]>0) res=min(res, E[i]); cout<<res<<endl; } }