hiho week 119 register

Ended

Participants:2176

Verdict:Accepted
Score:100 / 100
Submitted:2016-10-09 00:31:06

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 <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
const int maxn = 407;
const int inf  = 1 << 30;
int n, m, E_cnt, S, T;
int head[maxn], dis[maxn], que[maxn];
struct Edge
{
    int v, cap,next;
    Edge() {}
    Edge(int v, int cap, int next)
        : v(v), cap(cap), next(next) {}
}edges[maxn * 200];
void init()
{
    E_cnt = 0;
    memset(head, -1, sizeof(head));
}
void addEdge(int u, int v, int cap)
{
    edges[E_cnt] = Edge(v, cap, head[u]); head[u] = E_cnt ++;
    edges[E_cnt] = Edge(u,  0,  head[v]); head[v] = E_cnt ++;
}
bool bfs()
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX