#P2455. [SDOI2006] 线性方程组
[SDOI2006] 线性方程组
Description
Given an -variable linear system of equations:
$$\begin{cases} a_{1, 1} x_1 + a_{1, 2} x_2 + \cdots + a_{1, n} x_n = b_1 \\ a_{2, 1} x_1 + a_{2, 2} x_2 + \cdots + a_{2, n} x_n = b_2 \\ \cdots \\ a_{n,1} x_1 + a_{n, 2} x_2 + \cdots + a_{n, n} x_n = b_n \end{cases}$$Based on the input, write a program to output the status of the solution set.
Input Format
The first line contains the number of unknowns .
Then lines follow, each containing integers, representing the coefficients of each equation and the value on the right-hand side.
Output Format
If there is a unique solution, output the solution. Your result is considered correct if and only if, for every , the absolute error or the relative error compared to the standard answer does not exceed .
If the system has no solution, output ;
if it has infinitely many real solutions, output .
3
2 -1 1 1
4 1 -1 5
1 1 1 0
x1=1.00
x2=0.00
x3=-1.00
Hint
Constraints
For of the testdata, . For all , , .
Translated by ChatGPT 5
京公网安备 11011102002149号