hiho week 56 register

Ended

Participants:489

Verdict:Accepted
Score:100 / 100
Submitted:2015-07-30 14:48:00

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 <vector>
#include <algorithm>
using namespace std;
int N, M; 
bool is_zero(vector<double> &col)
{
    bool is = true;
    for (int i = 0; i < N; i++)
        is &= (col[i] == 0);
    return is;
}
void col_exchange(vector<vector<double>> &m, int i, int j)
{
    if (i == j)
        return;
    for (int x = 0; x <= N; x++)
        swap(m[i][x], m[j][x]);
}
int gauss(vector<vector<double>> &m, vector<double> &res)
//1 one solution, -1 no solution, 0 many solution
{
    for (int i = 0; i < N; i++)
    {
        bool is_ex = false;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX