結果

問題 No.453 製薬会社
ユーザー HAHAHAHAHAHA
提出日時 2016-12-27 15:27:14
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 1,417 ms
コンパイル使用メモリ 164,112 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-21 14:43:36
合計ジャッジ時間 2,248 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 2 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;


// X = 4x/3 [y = (x/3)]
// Y = min(7x/2, 7y/5)
// 1000X+2000Y=Z(maximalize)

double x,y;
double calc(double a){
	return (4*a/3*1000 + min(7*(x-a)/2, 7*(x-a/3)/5) *2000);
}

int main(){
	cin >> x >> y;
	double low=0,high=min(x,y*3);
	for(int i=0;i<500;i++){
		double l = (low * 2 + high) /3;
		double r = (low + high * 2) /3;
		if(calc(l) < calc(r)) low = l;
		else high = r;
	}
	
	printf("%.10lf\n", calc(low));
	return 0;
}
0