結果
| 問題 |
No.453 製薬会社
|
| コンテスト | |
| ユーザー |
tsutaj
|
| 提出日時 | 2016-12-07 14:40:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,766 bytes |
| コンパイル時間 | 926 ms |
| コンパイル使用メモリ | 95,724 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-28 03:20:40 |
| 合計ジャッジ時間 | 1,234 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 |
ソースコード
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;
#define rep(i,a,n) for(int i=a; i<n; i++)
#define repq(i,a,n) for(int i=a; i<=n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int
#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))
typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;
typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;
namespace std {
bool operator<(const P& a, const P& b) {
return a.X != b.X ? a.X < b.X : a.Y < b.Y;
}
}
double f(double x, double y) {
return 1000 * x + 2000 * y;
}
signed main() {
double c, d; cin >> c >> d;
double x0, y0, px, py;
x0 = min(c * 4 / 3.0, d * 4.0);
y0 = min(c * 7 / 2.0, d * 7 / 5.0);
py = 7 * (3*d - c) / 13;
px = (28 * c - 8 * py) / 21;
if(px < 0 || py < 0) {
px = 0; py = 0;
}
double ans = 0;
ans = max(max(f(x0,0), f(0,y0)), f(px, py));
cout << fixed << setprecision(15) << ans << endl;
return 0;
}
tsutaj