結果

問題 No.23 技の選択
ユーザー GOTKAKO
提出日時 2025-05-16 18:12:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 368 bytes
コンパイル時間 2,073 ms
コンパイル使用メモリ 195,892 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-05-16 18:12:06
合計ジャッジ時間 3,454 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int H,A,D; cin >> H >> A >> D;
    vector<double> dp(H+100000);
    for(int i=H-1; i>=0; i--){
        double now = min(dp.at(i+A)+1,dp.at(i+D)+1.5);
        dp.at(i) = now;
    }
    cout << fixed << setprecision(20) << dp.at(0) << endl;
}
0