結果

問題 No.306 さいたま2008
ユーザー nCk_cvnCk_cv
提出日時 2015-11-27 23:27:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 708 bytes
コンパイル時間 3,288 ms
コンパイル使用メモリ 75,380 KB
実行使用メモリ 56,496 KB
最終ジャッジ日時 2023-10-12 00:49:50
合計ジャッジ時間 5,567 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,080 KB
testcase_01 AC 116 ms
55,936 KB
testcase_02 AC 116 ms
55,824 KB
testcase_03 AC 114 ms
55,836 KB
testcase_04 AC 113 ms
55,308 KB
testcase_05 AC 117 ms
55,852 KB
testcase_06 AC 117 ms
55,900 KB
testcase_07 AC 115 ms
55,400 KB
testcase_08 AC 117 ms
56,496 KB
testcase_09 AC 116 ms
55,460 KB
testcase_10 AC 118 ms
56,092 KB
testcase_11 AC 117 ms
55,460 KB
testcase_12 AC 115 ms
55,628 KB
testcase_13 AC 113 ms
56,068 KB
testcase_14 AC 113 ms
55,816 KB
testcase_15 AC 117 ms
55,484 KB
testcase_16 AC 118 ms
55,564 KB
testcase_17 AC 117 ms
56,384 KB
testcase_18 AC 117 ms
55,860 KB
testcase_19 AC 114 ms
55,976 KB
testcase_20 AC 116 ms
56,120 KB
testcase_21 AC 116 ms
56,104 KB
testcase_22 AC 119 ms
56,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.Map.Entry;
import java.math.*;
import java.awt.geom.*;
import java.io.*;
      
      
public class Main {	

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int xa = sc.nextInt();
		int ya = sc.nextInt();
		int xb = sc.nextInt();
		int yb = sc.nextInt();
		int xa2 = -xa;
		int ya2 = ya;
		// p1 p3 y直線 Y O 
		// p2 p4      A2 B
		double S1 = ((xb - xa2) * (10000.0 - ya2) - (yb - ya2) * (0 - xa2)) / 2.0;
		double S2 = ((xb - xa2) * (ya2     - 0.0) - (yb - ya2) * (xa2 - 0)) / 2.0;
		

		double X = 0 + (0 - 10000) * S1 / (S1 + S2);
		double Y = 10000 + (0 - 10000) * S1 / (S1 + S2);
		
		System.out.printf("%.20f",Y);
		
		
	}
	
}
0