結果

問題 No.236 鴛鴦茶
ユーザー bigbear90560bigbear90560
提出日時 2015-07-15 03:47:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 629 bytes
コンパイル時間 3,633 ms
コンパイル使用メモリ 71,764 KB
実行使用メモリ 57,844 KB
最終ジャッジ日時 2023-09-22 16:05:18
合計ジャッジ時間 7,694 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,812 KB
testcase_01 AC 130 ms
55,564 KB
testcase_02 AC 124 ms
55,960 KB
testcase_03 AC 123 ms
55,972 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 125 ms
55,768 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

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 (r < l) {
        	d = x + y - (r - l) / (double) b;
        } else {
        	d = x + y - (l - r) / (double) a;
        }
        
    	System.out.println(d);
	}

}
0