結果
問題 | No.23 技の選択 |
ユーザー |
![]() |
提出日時 | 2020-06-05 07:34:09 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 426 bytes |
コンパイル時間 | 2,408 ms |
コンパイル使用メモリ | 193,284 KB |
最終ジャッジ日時 | 2025-01-10 21:33:29 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 WA * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; int main() { ios::sync_with_stdio(false); cin.tie(0); int H, A, D; cin >> H >> A >> D; vector<double> dp(H + 1, INF); dp[0] = 0; for (int i = 0; i < H + 1; i++) { dp[i] = min((i - A < 0 ? 0 : dp[i - A]) + 1.0, (i - D < 0 ? 0 : dp[i - D]) + 1.5); } cout << fixed << setprecision(10) << dp[H] << '\n'; return 0; }