hiho week 116 register

Ended

Participants:819

Verdict:Accepted
Score:100 / 100
Submitted:2016-09-20 00:05: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 <iostream>
#include <queue>
#include <cstring>
using namespace std;
#define MAX_N 501
#define INF 0x3f3f3f3f
int cf[MAX_N][MAX_N];
int path[MAX_N];
int capacity[MAX_N];
bool visited[MAX_N];
queue<int> q;
int cut[MAX_N]; 
int min(int a, int b){
    return a < b ? a : b;
}
int findAugmentPath(int s, int t){
    while(!q.empty()){
        q.pop();
    }
    memset(visited, 0, sizeof(visited));
    memset(capacity, 0, sizeof(capacity));
    
    q.push(s);
    visited[s] = true;
    capacity[s] = INF;
    
    while(!q.empty()){
        int u = q.front();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX