hiho week 118 register

Ended

Participants:1068

Verdict:Accepted
Score:100 / 100
Submitted:2016-10-03 11:44:50

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<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int mx=1e3;
vector<int>g[mx];
int from[mx];
bool vs[mx];
bool dfs(int u){
    for (int i=0;i<g[u].size();i++){
        int v=g[u][i];
        if (!vs[v]){
            vs[v]=true;
            if (from[v]==-1||dfs(from[v])){
                from[v]=u;
                return true;
            }
        }
    }
    return false;
}
int sove(int n){
    int ans=0;
    for (int i=1;i<=n;i++)
    {
        memset(vs,false,sizeof(vs));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX