結果

問題 No.306 さいたま2008
ユーザー 14番14番
提出日時 2016-05-16 15:00:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 984 bytes
コンパイル時間 2,084 ms
コンパイル使用メモリ 74,472 KB
実行使用メモリ 37,168 KB
最終ジャッジ日時 2024-04-15 22:26:12
合計ジャッジ時間 4,302 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
36,684 KB
testcase_01 AC 52 ms
36,908 KB
testcase_02 AC 51 ms
36,812 KB
testcase_03 AC 52 ms
37,024 KB
testcase_04 AC 52 ms
36,932 KB
testcase_05 AC 53 ms
36,980 KB
testcase_06 AC 51 ms
36,652 KB
testcase_07 AC 51 ms
36,684 KB
testcase_08 AC 52 ms
36,664 KB
testcase_09 AC 51 ms
37,092 KB
testcase_10 AC 51 ms
37,016 KB
testcase_11 AC 52 ms
37,168 KB
testcase_12 AC 51 ms
36,964 KB
testcase_13 AC 53 ms
36,896 KB
testcase_14 AC 51 ms
37,104 KB
testcase_15 AC 52 ms
36,680 KB
testcase_16 AC 53 ms
37,016 KB
testcase_17 AC 52 ms
36,964 KB
testcase_18 AC 54 ms
37,044 KB
testcase_19 AC 54 ms
36,980 KB
testcase_20 AC 53 ms
36,936 KB
testcase_21 AC 52 ms
36,696 KB
testcase_22 AC 53 ms
36,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;

public class Main {

	public BufferedReader br;

	/**
	 * メイン処理
	 * @throws IOException
	 */
	public void Proc() throws IOException {
		String[] inpt = br.readLine().split(" ");
		int x1 = Integer.parseInt(inpt[0]);
		int y1 = Integer.parseInt(inpt[1]);
		inpt = br.readLine().split(" ");
		int x2 = Integer.parseInt(inpt[0]);
		int y2 = Integer.parseInt(inpt[1]);
		
		x2 *= -1;
		
		double ans = y1 - ((double)x1 * (y1 - y2) / (x1 - x2));
		System.out.println(ans);


	}


	public static void main(String[] args)  {
		Main mn = new Main();
		mn.br = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
		try {
			mn.Proc();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} finally {
			try {
				mn.br.close();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
		}
	}


}

0