結果

問題 No.306 さいたま2008
ユーザー 14番
提出日時 2016-05-16 15:00:25
言語 Java
(openjdk 23)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 984 bytes
コンパイル時間 2,069 ms
コンパイル使用メモリ 76,120 KB
実行使用メモリ 53,100 KB
最終ジャッジ日時 2025-02-14 12:13:06
合計ジャッジ時間 4,415 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

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