結果
| 問題 |
No.23 技の選択
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-22 05:05:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 482 bytes |
| コンパイル時間 | 734 ms |
| コンパイル使用メモリ | 70,752 KB |
| 最終ジャッジ日時 | 2025-01-13 06:45:41 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
#include <iostream>
#include <vector>
void solve() {
int h, a, d;
std::cin >> h >> a >> d;
std::vector<int> dp(h + 1, 0);
for (int x = 1; x <= h; ++x) {
dp[x] = std::min(dp[std::max(0, x - a)] + 2,
dp[std::max(0, x - d)] + 3);
}
int ans = dp[h];
std::cout << ans / 2 << (ans % 2 == 0 ? "" : ".5") << "\n";
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}