hiho week 115 register

Ended

Participants:333

Verdict:Accepted
Score:100 / 100
Submitted:2016-09-12 20:13: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 <cstdio>
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
static const int INF = 1e9;//±È0x3f3f3f3f»¹´ó
static const int MAXN = 100000;
struct Edge
{
    int from,to,cap,flow;
    Edge(int f,int t,int c,int ff)
        :from(f),to(t),cap(c),flow(ff) {};
};
vector<Edge> edges;
vector<int> G[MAXN];
int N,M,S,T,i,j;
int iter[MAXN],level[MAXN];
bool vis[MAXN];
void add_edge(int from ,int to ,int cap)
{
    edges.push_back(Edge(from , to , cap , 0 ));
    edges.push_back(Edge(to , from , 0 , 0));
    int sz = edges.size();
    G[from].push_back(sz-2);//¼Ç¼ÔÚEdge ÀïÃæµÄλÖÃ
    G[to].push_back(sz-1);
}
bool BFS( )
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX