結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
53,608 KB
testcase_01 AC 58 ms
53,612 KB
testcase_02 AC 57 ms
52,536 KB
testcase_03 AC 56 ms
53,616 KB
testcase_04 AC 58 ms
52,596 KB
testcase_05 WA -
testcase_06 AC 59 ms
52,460 KB
testcase_07 WA -
testcase_08 AC 59 ms
53,604 KB
testcase_09 WA -
testcase_10 AC 57 ms
53,640 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 57 ms
53,644 KB
testcase_14 WA -
testcase_15 AC 57 ms
52,584 KB
testcase_16 AC 57 ms
53,632 KB
testcase_17 AC 57 ms
52,532 KB
testcase_18 AC 58 ms
52,572 KB
testcase_19 AC 57 ms
53,640 KB
testcase_20 AC 59 ms
52,516 KB
testcase_21 AC 58 ms
53,620 KB
testcase_22 AC 58 ms
53,648 KB
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

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) {
			out(y + ((double)y / b) * a);
		} else if (y < x) {
			out(x + ((double)x / a) * b);
		} else {
			out(Math.min(x , y) * 2);
		}
		
	}
}
0