hiho week 56 register

Ended

Participants:489

Verdict:Accepted
Score:100 / 100
Submitted:2015-07-27 16:23:30

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
const int N=510,M=1050;
#define eps 1e-7
double A[M][N];
double x[N];
int Gauss(int equ,int var)
{
    int row,col;
    for(row=0,col=0;col<var&&row<equ;col++,row++)
    {
        int max_r=row;
        for(int i=row+1;i<equ;i++)
        {
            if(fabs(A[i][col])>fabs(A[max_r][col]))
            {
                max_r=i;
            }
        }
        if(max_r!=row)
        {
            for(int j=col;j<var+1;j++)
                swap(A[row][j],A[max_r][j]);
        }
        if(fabs(A[row][col])<eps)
        {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX