結果

問題 No.236 鴛鴦茶
ユーザー spaciaspacia
提出日時 2015-12-29 20:49:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 742 bytes
コンパイル時間 2,301 ms
コンパイル使用メモリ 75,652 KB
実行使用メモリ 53,668 KB
最終ジャッジ日時 2023-10-19 12:22:58
合計ジャッジ時間 4,781 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
52,472 KB
testcase_01 AC 61 ms
53,600 KB
testcase_02 AC 56 ms
53,612 KB
testcase_03 AC 56 ms
53,600 KB
testcase_04 AC 58 ms
53,644 KB
testcase_05 WA -
testcase_06 AC 60 ms
53,608 KB
testcase_07 AC 59 ms
52,612 KB
testcase_08 AC 59 ms
53,604 KB
testcase_09 AC 57 ms
52,484 KB
testcase_10 AC 62 ms
52,564 KB
testcase_11 AC 58 ms
53,636 KB
testcase_12 WA -
testcase_13 AC 59 ms
52,592 KB
testcase_14 WA -
testcase_15 AC 58 ms
52,584 KB
testcase_16 AC 60 ms
52,588 KB
testcase_17 AC 61 ms
53,620 KB
testcase_18 AC 58 ms
52,484 KB
testcase_19 AC 59 ms
53,648 KB
testcase_20 AC 64 ms
52,492 KB
testcase_21 AC 60 ms
51,620 KB
testcase_22 AC 58 ms
52,572 KB
testcase_23 AC 58 ms
52,492 KB
testcase_24 AC 59 ms
53,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main236 {
	
	public static void out (Object out) {
		System.out.println(out);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		int a = Integer.parseInt(line[0]);
		int b = Integer.parseInt(line[1]);
		int x = Integer.parseInt(line[2]);
		int y = Integer.parseInt(line[3]);
		
		if (a < b) {
			double d = (double)y / b * a;
			out(d <= x ? y + d : x + ((double)x / a * b));
		} else if (b < a) {
			double d = (double)x / a * b;
			out(d <= y ? x + d : y + ((double)y / a * b));
		} else {
			out(Math.min(x , y) * 2);
		}
		
	}
}
0