結果
問題 | No.23 技の選択 |
ユーザー |
![]() |
提出日時 | 2020-06-05 07:34:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 426 bytes |
コンパイル時間 | 1,856 ms |
コンパイル使用メモリ | 194,692 KB |
最終ジャッジ日時 | 2025-01-10 21:33:47 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
ソースコード
#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 = 1; 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; }