結果

問題 No.236 鴛鴦茶
ユーザー tentententen
提出日時 2020-12-07 12:21:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 2,130 ms
コンパイル使用メモリ 77,700 KB
実行使用メモリ 57,676 KB
最終ジャッジ日時 2023-10-17 16:27:36
合計ジャッジ時間 6,780 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
57,604 KB
testcase_01 AC 127 ms
57,528 KB
testcase_02 AC 127 ms
57,504 KB
testcase_03 AC 127 ms
57,364 KB
testcase_04 AC 128 ms
57,392 KB
testcase_05 AC 130 ms
57,380 KB
testcase_06 AC 130 ms
57,568 KB
testcase_07 AC 128 ms
57,428 KB
testcase_08 AC 130 ms
57,676 KB
testcase_09 AC 129 ms
57,600 KB
testcase_10 AC 126 ms
57,476 KB
testcase_11 AC 129 ms
57,564 KB
testcase_12 AC 128 ms
57,516 KB
testcase_13 AC 128 ms
57,488 KB
testcase_14 AC 133 ms
57,656 KB
testcase_15 AC 129 ms
57,436 KB
testcase_16 AC 126 ms
57,184 KB
testcase_17 AC 133 ms
57,480 KB
testcase_18 AC 130 ms
57,532 KB
testcase_19 AC 129 ms
57,536 KB
testcase_20 AC 128 ms
57,620 KB
testcase_21 AC 129 ms
57,556 KB
testcase_22 AC 132 ms
57,664 KB
testcase_23 AC 129 ms
57,428 KB
testcase_24 AC 132 ms
57,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    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 ans;
        if (x * b <= y * a) {
            ans = (double)x / a * b + x;
        } else {
            ans = (double)y / b * a + y;
        }
        System.out.println(ans);
    }
}
0