結果
| 問題 | No.23 技の選択 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-05-01 16:50:36 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 349 bytes | 
| コンパイル時間 | 351 ms | 
| コンパイル使用メモリ | 58,404 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-28 16:46:57 | 
| 合計ジャッジ時間 | 1,173 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 33 | 
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int H, A, D;
	cin >> H >> A >> D;
	int CA = min((H + A - 1) / A, ((H + D - 1) / D * 3 + 1)/ 2);
	double C = CA;
	for (int ca = 0; ca <= CA; ca++) {
		int h = max(H - ca * A, 0);
		double cd = (h + D - 1) / D * 1.5;
		if (ca + cd < C) {
			C = ca + cd;
		}
	}
	cout << C;
}
            
            
            
        