[Offer收割]编程练习赛28 register

Ended

Participants:277

Verdict:Accepted
Score:100 / 100
Submitted:2017-09-24 12:56:33

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 <bits/stdc++.h>
using namespace std;
const int N = 103;
int match[N][N], matchIdx;
const int MAXN = 10011;
const int MAXM = 100011;
const int INF = (1 << 30);
struct Edge {
    int next, from, to, cap, cost;
};
struct MCMF {
    Edge edge[MAXM];
    int head[MAXN], countedge;
    void Init(int N) {
        this->N = N;
        memset(head, -1, sizeof(head));
        countedge = 0;
    }
    int N;
    int inq[MAXN], dis[MAXN], pre[MAXN], ad[MAXN];
    void AddEdge(const int& start, const int& end, const int& cap,
                 const int& cost) {
        edge[countedge].to = end;
        edge[countedge].from = start;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX