結果

問題 No.236 鴛鴦茶
ユーザー troro_kelptroro_kelp
提出日時 2018-06-22 17:23:15
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 1,248 ms
コンパイル使用メモリ 159,576 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 18:00:49
合計ジャッジ時間 2,260 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;


int main() {
    double A, B, X, Y; cin >> A >> B >> X >> Y;
    if(A==B) cout << min(X, Y)*2 << endl;
    else if(A<B){
        if(Y*A/B<X) cout << fixed<< Y+Y*A/B << endl;
        else cout <<fixed<< X*B/A+X << endl; 
    }else if(A>B){
        if(X*B/A<Y) cout <<fixed << X+X*B/A << endl;
        else cout << fixed <<Y*A/B+Y << endl; 
    }
    return 0;
}
0