結果
問題 |
No.23 技の選択
|
ユーザー |
|
提出日時 | 2025-10-15 19:47:26 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 341 bytes |
コンパイル時間 | 3,397 ms |
コンパイル使用メモリ | 275,684 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-10-15 19:47:32 |
合計ジャッジ時間 | 4,655 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> using namespace std; double dp[10010]; void solve(){ int H,A,D; cin>>H>>A>>D; dp[0]=0; for(int i=1;i<=H;++i){ dp[i]=min(1.0+(i-A>=0?dp[i-A]:0),1.5+(i-D>=0?dp[i-D]:0)); } cout<<dp[H]<<endl; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0; }