結果

問題 No.236 鴛鴦茶
ユーザー Elk
提出日時 2018-06-25 23:17:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 470 bytes
コンパイル時間 1,451 ms
コンパイル使用メモリ 165,860 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 22:43:21
合計ジャッジ時間 2,293 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    int A, B, X, Y;
    double diviAB, diviBA;

    cin >> A >> B >> X >> Y;
    diviAB = (double)A/B;
    diviBA = (double)B/A;

    if(A == B){
        if(X <= Y){
            cout << 2*X << endl;
        }else{
            cout << 2*Y << endl;
        }
        return 0;
    }else if(A*Y >= X*B){
        cout << X + diviBA*X << endl;
    }else{
        cout << Y + diviAB*Y << endl;
    }
    return 0;

}
0