結果

問題 No.1175 Simultaneous Equations
ユーザー kyo1kyo1
提出日時 2020-08-31 07:46:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 273 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 8,064 KB
最終ジャッジ日時 2023-08-09 19:23:48
合計ジャッジ時間 1,370 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,880 KB
testcase_01 AC 16 ms
7,876 KB
testcase_02 AC 15 ms
7,840 KB
testcase_03 AC 16 ms
7,844 KB
testcase_04 AC 16 ms
7,844 KB
testcase_05 AC 16 ms
8,040 KB
testcase_06 AC 16 ms
7,832 KB
testcase_07 AC 16 ms
8,064 KB
testcase_08 AC 16 ms
7,944 KB
testcase_09 AC 16 ms
7,848 KB
testcase_10 AC 16 ms
8,020 KB
testcase_11 AC 15 ms
7,840 KB
testcase_12 AC 15 ms
7,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

a, b, c, d, e, f = map(int, input().split())


def lcm(a, b):
    return a / math.gcd(a, b) * b


p = lcm(a, d) / a
q = lcm(a, d) / d
x = (q * f - p * c) / (q * e - p * b)

p = lcm(b, e) / b
q = lcm(b, e) / e
y = (q * f - p * c) / (q * d - p * a)

print(y, x)
0