結果

問題 No.306 さいたま2008
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-07-01 01:13:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 3,526 ms
コンパイル使用メモリ 71,272 KB
実行使用メモリ 56,768 KB
最終ジャッジ日時 2023-09-13 16:27:36
合計ジャッジ時間 7,938 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
56,396 KB
testcase_01 AC 132 ms
56,036 KB
testcase_02 AC 131 ms
54,500 KB
testcase_03 AC 132 ms
56,160 KB
testcase_04 AC 132 ms
55,708 KB
testcase_05 AC 131 ms
56,440 KB
testcase_06 AC 132 ms
56,432 KB
testcase_07 AC 133 ms
55,988 KB
testcase_08 AC 134 ms
56,448 KB
testcase_09 AC 134 ms
56,528 KB
testcase_10 AC 133 ms
56,432 KB
testcase_11 AC 134 ms
56,036 KB
testcase_12 AC 133 ms
56,512 KB
testcase_13 AC 134 ms
56,064 KB
testcase_14 AC 134 ms
55,880 KB
testcase_15 AC 134 ms
56,108 KB
testcase_16 AC 133 ms
56,380 KB
testcase_17 AC 133 ms
56,288 KB
testcase_18 AC 134 ms
56,528 KB
testcase_19 AC 134 ms
56,360 KB
testcase_20 AC 132 ms
55,916 KB
testcase_21 AC 133 ms
56,764 KB
testcase_22 AC 133 ms
56,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

		double ax = sc.nextDouble();
		double ay = sc.nextDouble();
		double bx = sc.nextDouble();
		double by = sc.nextDouble();

		double py;
		if(ay > by){
			py = (bx/(ax+bx))*(ay-by) + by;
		}else if(by > ay){
			py = (ax/(ax+bx))*(by-ay) + ay;
		}else{
			py = ay;
		}
		System.out.println(py);
	}
}
0