結果

問題 No.236 鴛鴦茶
ユーザー bigbear90560bigbear90560
提出日時 2015-07-15 03:56:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 629 bytes
コンパイル時間 3,811 ms
コンパイル使用メモリ 71,788 KB
実行使用メモリ 56,024 KB
最終ジャッジ日時 2023-09-10 21:50:44
合計ジャッジ時間 8,764 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,988 KB
testcase_01 AC 124 ms
55,632 KB
testcase_02 AC 126 ms
55,584 KB
testcase_03 AC 125 ms
55,644 KB
testcase_04 AC 125 ms
55,416 KB
testcase_05 AC 127 ms
55,984 KB
testcase_06 AC 125 ms
55,756 KB
testcase_07 AC 125 ms
55,616 KB
testcase_08 AC 125 ms
55,948 KB
testcase_09 AC 127 ms
55,608 KB
testcase_10 AC 124 ms
55,772 KB
testcase_11 AC 124 ms
55,628 KB
testcase_12 AC 124 ms
56,008 KB
testcase_13 AC 125 ms
55,936 KB
testcase_14 AC 125 ms
56,024 KB
testcase_15 AC 125 ms
55,980 KB
testcase_16 AC 125 ms
55,740 KB
testcase_17 AC 124 ms
55,568 KB
testcase_18 AC 123 ms
55,564 KB
testcase_19 AC 124 ms
55,664 KB
testcase_20 AC 125 ms
55,416 KB
testcase_21 AC 124 ms
55,616 KB
testcase_22 AC 126 ms
55,924 KB
testcase_23 AC 125 ms
55,760 KB
testcase_24 AC 126 ms
55,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

/**
 * No.236 鴛鴦茶
 */
public class OshidoriTea {

	public static void main(String[] args) {

		// 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();

        int l = a * y;
        int r = b * x;
        
        double d = 0d;
        if (l >= r) {
        	d = x + y - (l - r) / (double) a;
        } else {
        	d = x + y - (r - l) / (double) b;
        }
    	System.out.printf("%.8f\n",d);
	}

}
0