結果

問題 No.1175 Simultaneous Equations
ユーザー ApassApass
提出日時 2020-08-21 21:49:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 1,066 bytes
コンパイル時間 3,662 ms
コンパイル使用メモリ 76,080 KB
実行使用メモリ 40,416 KB
最終ジャッジ日時 2024-04-23 05:47:17
合計ジャッジ時間 5,440 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
38,056 KB
testcase_01 AC 89 ms
40,416 KB
testcase_02 AC 88 ms
40,268 KB
testcase_03 AC 85 ms
38,204 KB
testcase_04 AC 85 ms
38,644 KB
testcase_05 AC 85 ms
40,076 KB
testcase_06 AC 93 ms
40,008 KB
testcase_07 AC 83 ms
38,604 KB
testcase_08 AC 88 ms
40,120 KB
testcase_09 AC 97 ms
40,148 KB
testcase_10 AC 86 ms
39,968 KB
testcase_11 AC 84 ms
38,280 KB
testcase_12 AC 85 ms
38,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

// https://yukicoder.me/problems/no/1141
public class A_SimultaneousEquations {
    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static final PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    private static StringTokenizer st;

    private static int readInt() throws IOException {
        while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return Integer.parseInt(st.nextToken());
    }

    public static void main(String[] args) throws IOException {
        solve();
        pw.close();
    }

    private static void solve() throws IOException {
        double a = readInt();
        double b = readInt();
        double c = readInt();
        double d = readInt();
        double e = readInt();
        double f = readInt();

        double x = (c * e - f * b) / (a * e - d * b);
        double y = (-c * d + f * a) / (a * e - d * b);

        pw.println(x + " " + y);
    }
}
0