結果

問題 No.306 さいたま2008
ユーザー kuramukuramu
提出日時 2016-02-02 11:24:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 1,918 ms
コンパイル使用メモリ 74,432 KB
実行使用メモリ 53,584 KB
最終ジャッジ日時 2023-10-21 18:40:44
合計ジャッジ時間 4,026 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
53,576 KB
testcase_01 AC 51 ms
53,572 KB
testcase_02 AC 52 ms
53,572 KB
testcase_03 AC 52 ms
53,584 KB
testcase_04 AC 53 ms
53,576 KB
testcase_05 AC 52 ms
53,576 KB
testcase_06 AC 52 ms
53,576 KB
testcase_07 AC 51 ms
53,560 KB
testcase_08 AC 53 ms
53,576 KB
testcase_09 AC 52 ms
53,576 KB
testcase_10 AC 52 ms
53,576 KB
testcase_11 AC 52 ms
52,448 KB
testcase_12 AC 52 ms
53,564 KB
testcase_13 AC 52 ms
53,576 KB
testcase_14 AC 53 ms
53,576 KB
testcase_15 AC 52 ms
53,576 KB
testcase_16 AC 54 ms
53,568 KB
testcase_17 AC 53 ms
53,576 KB
testcase_18 AC 54 ms
53,568 KB
testcase_19 AC 53 ms
53,560 KB
testcase_20 AC 52 ms
53,576 KB
testcase_21 AC 53 ms
53,572 KB
testcase_22 AC 55 ms
53,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {

	 public static void main(String[] args) {
	      BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
	      try {
	    	  String[] line1 = stdReader.readLine().split(" ");
	    	  String[] line2 = stdReader.readLine().split(" ");
	    	  int x1 = Integer.parseInt(line1[0]);
	    	  int y1 = Integer.parseInt(line1[1]);
	    	  int x2 = -1*Integer.parseInt(line2[0]);
	    	  int y2 = Integer.parseInt(line2[1]);
	    	  
	    	  double slope = (double)(y2-y1) / (x2-x1);
	    	  double intercept = y2-slope*x2;	    	  
	    	  System.out.println(intercept);
	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0