結果
問題 | No.1230 Hall_and_me |
ユーザー |
|
提出日時 | 2020-09-18 22:28:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 18 ms / 2,000 ms |
コード長 | 669 bytes |
コンパイル時間 | 1,947 ms |
コンパイル使用メモリ | 198,392 KB |
最終ジャッジ日時 | 2025-01-14 17:29:28 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 36 |
ソースコード
#include <bits/stdc++.h>using namespace std;#include <math.h>#include <iomanip>template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }const int INF=1001001001;const int mod=1e9+7;int main(){vector<double>t(3);cin>>t[0]>>t[1]>>t[2];sort(t.begin(),t.end());if(t[0]==0&&t[1]==0){cout<<1<<endl;return 0;}double x=t[2]/(t[0]+t[1]+t[2]);double y=t[1]/(t[0]+t[1]+t[2]);double z=t[0]/(t[0]+t[1]+t[2]);cout<<fixed<<setprecision(10)<<max({max(y,1-y),max(z,1-z),max(x,1-x)})<<endl;return 0;}