結果
問題 |
No.1230 Hall_and_me
|
ユーザー |
|
提出日時 | 2020-09-18 22:02:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 991 bytes |
コンパイル時間 | 1,438 ms |
コンパイル使用メモリ | 166,848 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-22 09:37:44 |
合計ジャッジ時間 | 2,591 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const long long INF = 1e18; # define len(x) ((int)(x).size()) # define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i) # define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i) # define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i) # define rreps(i, n) for(int i=((int)(n)); i>0; --i) # define foreps(i, m, n) for(int i = m;i < n;i++) # define ALL(x) (x).begin(), (x).end() # define rall(x) (x).rbegin(), (x).rend() template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } int main() { cout << fixed << setprecision(10); ld P, Q, R; cin >> P >> Q >> R; ld Pn = P / (P + Q + R), Rn = R / (P + Q + R), Qn = Q / (P + Q + R); ld Select = max(Pn, max(Rn, Qn)); ld ans = max(max(Pn, max(Rn, Qn)), min(Rn, Qn) + max(Rn, Qn)); cout << ans << endl; }