hiho week 194 register

Ended

Participants:187

Verdict:Accepted
Score:100 / 100
Submitted:2018-03-24 11:39:42

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 <cstdio>
# include <cmath>
# include <cstring>
# include <algorithm>
using namespace std;
const int MAXN = 1e4 + 5;
int equ, var;
double a[MAXN][100];
double x[MAXN];
double A[70][70];
void guass() {
    for (int i = 0; i < equ; i++) {
        int maxRow = i;
        double maxV = fabs(a[i][i]);
        for (int j = i + 1; j < equ; j++) {
            if (maxV < fabs(a[j][i])) {
                maxV = fabs(a[j][i]);
                maxRow = j;
            }
        }
        // 
        for (int j = i; j <= var; j++) {
            swap(a[i][j], a[maxRow][j]);
        }
        // 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX