hiho week 118 register

Ended

Participants:1068

Verdict:Accepted
Score:100 / 100
Submitted:2016-10-01 21:29:27

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 <cstring>
#include <vector>
#include <queue>
#include <cstdio>
using namespace std;
vector<int> map[505];
int link[505];
bool has[505];
int yanse[505];
bool used[505];
int fenpei(int x) {
    for (int j = 0; j < map[x].size(); ++j) {
        int tmp = map[x][j];
        if (!has[tmp]) {
            has[tmp] = 1;
            if (!link[tmp] || fenpei(link[tmp])) {
                link[tmp] = x;
                return 1;
            }
        }
    }
    return 0;
}
int main() {
    int n, m;
    while (cin >> n >> m) {
        for (int i = 1; i <= n; ++i) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX