結果

問題 No.236 鴛鴦茶
ユーザー TatsuDXTatsuDX
提出日時 2016-09-03 16:56:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 431 bytes
コンパイル時間 6,360 ms
コンパイル使用メモリ 72,148 KB
実行使用メモリ 56,348 KB
最終ジャッジ日時 2023-09-10 22:07:26
合計ジャッジ時間 9,989 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,088 KB
testcase_01 AC 135 ms
56,096 KB
testcase_02 AC 135 ms
56,048 KB
testcase_03 AC 134 ms
55,852 KB
testcase_04 AC 136 ms
56,072 KB
testcase_05 AC 135 ms
53,912 KB
testcase_06 AC 136 ms
55,892 KB
testcase_07 AC 136 ms
56,080 KB
testcase_08 AC 136 ms
55,608 KB
testcase_09 AC 136 ms
55,964 KB
testcase_10 AC 135 ms
55,792 KB
testcase_11 AC 135 ms
55,832 KB
testcase_12 AC 137 ms
55,892 KB
testcase_13 AC 139 ms
55,880 KB
testcase_14 AC 136 ms
55,964 KB
testcase_15 AC 137 ms
56,048 KB
testcase_16 AC 136 ms
55,996 KB
testcase_17 AC 136 ms
55,984 KB
testcase_18 AC 136 ms
55,588 KB
testcase_19 AC 143 ms
53,932 KB
testcase_20 AC 142 ms
56,128 KB
testcase_21 AC 142 ms
56,052 KB
testcase_22 AC 140 ms
55,580 KB
testcase_23 AC 137 ms
56,348 KB
testcase_24 AC 135 ms
55,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

		double a, b, ra, rb, ca, cb, ans;
		ra = sc.nextDouble();
		rb = sc.nextDouble();
		a = sc.nextDouble();
		b = sc.nextDouble();
		ca = b*ra/rb;
		cb = a*rb/ra;
		if(a > ca){
			System.out.println(ca+b);
		} else if(b > cb){
			System.out.println(a+cb);
		} else {
			System.out.println(a+b);
		}
	}
}
0