結果

問題 No.1230 Hall_and_me
ユーザー deuteridayo
提出日時 2020-09-18 21:32:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 1,604 ms
コンパイル使用メモリ 167,420 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-22 09:03:48
合計ジャッジ時間 2,634 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
    int p,q,r;
    cin >> p >> q >> r;
    double a[6];
    a[0] = (double)p/(double)(p+q+r);
    a[1] = (double)q/(double)(p+q+r);
    a[2] = (double)r/(double)(p+q+r);
    a[3] = 1.0-a[0];
    a[4] = 1.0-a[1];
    a[5] = 1.0-a[2];
    double ans = a[0];
    for(int i=1;i<=5;i++){
        ans = max(ans,a[i]);
    }
   printf("%.10lf",ans);
    
}
0