結果

問題 No.236 鴛鴦茶
ユーザー 8130Tsk8130Tsk
提出日時 2015-08-19 00:51:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 3,412 ms
コンパイル使用メモリ 73,176 KB
実行使用メモリ 57,932 KB
最終ジャッジ日時 2023-09-10 21:53:53
合計ジャッジ時間 8,045 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
55,612 KB
testcase_01 AC 137 ms
55,620 KB
testcase_02 AC 133 ms
55,696 KB
testcase_03 AC 134 ms
55,680 KB
testcase_04 AC 126 ms
55,424 KB
testcase_05 AC 133 ms
55,828 KB
testcase_06 AC 128 ms
57,932 KB
testcase_07 AC 127 ms
55,740 KB
testcase_08 AC 128 ms
55,828 KB
testcase_09 AC 126 ms
55,424 KB
testcase_10 AC 127 ms
55,916 KB
testcase_11 AC 126 ms
55,600 KB
testcase_12 AC 126 ms
55,764 KB
testcase_13 AC 126 ms
55,684 KB
testcase_14 AC 126 ms
55,596 KB
testcase_15 AC 126 ms
55,848 KB
testcase_16 AC 125 ms
55,820 KB
testcase_17 AC 125 ms
56,056 KB
testcase_18 AC 125 ms
55,844 KB
testcase_19 AC 127 ms
55,948 KB
testcase_20 AC 127 ms
55,652 KB
testcase_21 AC 125 ms
55,408 KB
testcase_22 AC 127 ms
55,596 KB
testcase_23 AC 127 ms
56,136 KB
testcase_24 AC 126 ms
55,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No236 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		
		double w1=x*b/a - y;
		double w2=y*a/b - x;
		
		double d;
		
		if(w1<0){
			d = (double)x*b/a + x;
		}else if(w2<0){
			d = (double)y*a/b + y;
		}else{
			d = x+y;
		}
		
		System.out.printf("%.8f\n", d);
	}

}
0