結果

問題 No.23 技の選択
ユーザー やまぞうやまぞう
提出日時 2015-05-01 16:45:40
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 56,156 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 17:22:16
合計ジャッジ時間 1,489 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int H, A, D;
	//cin >> H >> A >> D;
	H = 49; A = 7; D = 17;

	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 = H - ca * A;
		double cd = (h + D - 1) / D * 1.5;
		if (ca + cd < C) {
			C = ca + cd;
		}
	}
	cout << C;
}
0