結果

問題 No.236 鴛鴦茶
ユーザー GrenacheGrenache
提出日時 2015-07-05 22:27:29
言語 Java19
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 576 bytes
コンパイル時間 4,320 ms
コンパイル使用メモリ 72,224 KB
実行使用メモリ 55,980 KB
最終ジャッジ日時 2023-09-10 21:46:44
合計ジャッジ時間 8,451 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,464 KB
testcase_01 AC 129 ms
55,796 KB
testcase_02 AC 128 ms
55,520 KB
testcase_03 AC 127 ms
55,684 KB
testcase_04 AC 128 ms
55,724 KB
testcase_05 AC 128 ms
55,764 KB
testcase_06 AC 128 ms
55,980 KB
testcase_07 AC 129 ms
55,696 KB
testcase_08 AC 126 ms
55,944 KB
testcase_09 AC 126 ms
55,416 KB
testcase_10 AC 133 ms
55,612 KB
testcase_11 AC 130 ms
55,708 KB
testcase_12 AC 126 ms
53,776 KB
testcase_13 AC 130 ms
55,628 KB
testcase_14 AC 129 ms
55,616 KB
testcase_15 AC 130 ms
55,424 KB
testcase_16 AC 128 ms
55,668 KB
testcase_17 AC 128 ms
55,632 KB
testcase_18 AC 128 ms
55,568 KB
testcase_19 AC 128 ms
55,912 KB
testcase_20 AC 127 ms
55,704 KB
testcase_21 AC 129 ms
55,800 KB
testcase_22 AC 129 ms
55,628 KB
testcase_23 AC 128 ms
55,772 KB
testcase_24 AC 129 ms
55,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder236 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();

        double ret = 0;
        if (y * a > x * b) {
        	ret = (double)x * b / a + x;
        } else if (y * a < x * b) {
        	ret = (double)y * a / b + y;
        } else {
        	ret = x + y;
        }
        
        System.out.printf("%.7f\n", ret);
        
        sc.close();
    }
}
0