結果
| 問題 |
No.453 製薬会社
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-02-24 11:23:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 513 bytes |
| コンパイル時間 | 669 ms |
| コンパイル使用メモリ | 68,992 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-21 08:52:59 |
| 合計ジャッジ時間 | 1,457 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 |
ソースコード
#include<iostream>
#include<iomanip>
using namespace std;
// 実行可能領域の頂点だけ調べればよい?
int main(){
double c, d;
cin >> c >> d;
auto f = [=](double x, double y)->double{
return 1000*x + 2000*y;
};
double ans = max(f(0, min(7*d/5, 7*c/2)), f(min(4*c/3, 4*d), 0));
double a = (20*c-8*d)/13, b = (21*d-7*c)/13;
if(a >= 0 && b >= 0) ans = max(ans, f((20*c-8*d)/13, (21*d-7*c)/13));
cout << fixed << setprecision(12) << ans << endl;
return 0;
}