hiho Week 34 register

Ended

Participants:146

Verdict:Accepted
Score:100 / 100
Submitted:2015-02-27 12:54:21

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<string>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int N=1111;
int pre[N],vis[N];
int n,m;
int map[N][N];
int search(int v)
{
    //cout<<v<<endl;
    for (int u=1;u<=n;u++)  if (map[v][u] && !vis[u])
    {
        vis[u]=1;
        if (pre[u]==0 || search(pre[u]))
        {
            pre[u]=v;
            pre[v]=u;
            return 1;
        }
    }
    return 0;
}
int main()
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX