結果

問題 No.236 鴛鴦茶
ユーザー syoken_desukasyoken_desuka
提出日時 2015-07-05 22:34:38
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,045 bytes
コンパイル時間 786 ms
コンパイル使用メモリ 81,996 KB
実行使用メモリ 7,732 KB
最終ジャッジ日時 2023-09-22 06:34:44
合計ジャッジ時間 4,259 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <ostream>
#include<complex>
#include <cmath>
#include <iostream>
#include <stack>
#include <fstream>
#include <queue>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <string>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;

double x,y,a,b;


double ans;
bool func(double k)
{ 
    double n = a/(a+b);
    double m = b/(a+b);
    double aa = n * k;
    double bb = m * k;
    return x >= aa && y >= bb;
}

int main()
{ 
    cin >> a >> b >> x >> y;

    double mid;
    double low = -100;
    double hi = 5000;
    while(hi - low > 0.0000000000001)
    {
        mid = (hi + low)/2;
        if(func(mid))
        {
            low = mid;
        }
        else
        {
            hi = mid;
        }
    }
    cout << low << endl;
    return 0;
}
0