結果

問題 No.1175 Simultaneous Equations
ユーザー ks2mks2m
提出日時 2020-08-21 21:35:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 548 bytes
コンパイル時間 2,252 ms
コンパイル使用メモリ 76,704 KB
実行使用メモリ 55,272 KB
最終ジャッジ日時 2024-04-23 05:35:41
合計ジャッジ時間 4,225 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
55,044 KB
testcase_01 AC 142 ms
54,956 KB
testcase_02 AC 143 ms
55,252 KB
testcase_03 AC 142 ms
54,988 KB
testcase_04 AC 143 ms
54,840 KB
testcase_05 AC 142 ms
55,236 KB
testcase_06 AC 127 ms
55,092 KB
testcase_07 AC 139 ms
55,272 KB
testcase_08 AC 138 ms
55,184 KB
testcase_09 AC 141 ms
55,176 KB
testcase_10 AC 137 ms
55,016 KB
testcase_11 AC 126 ms
54,508 KB
testcase_12 AC 126 ms
54,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		double a = sc.nextInt();
		double b = sc.nextInt();
		double c = sc.nextInt();
		double d = sc.nextInt();
		double e = sc.nextInt();
		double f = sc.nextInt();
		sc.close();

		double q = b / e;
		double x1 = a - d * q;
		double x2 = c - f * q;
		double x = x2 / x1;

		double p = a / d;
		double y1 = b - e * p;
		double y2 = c - f * p;
		double y = y2 / y1;

		System.out.println(x + " " + y);
	}
}
0