hiho week 119 register

Ended

Participants:2176

Verdict:Accepted
Score:100 / 100
Submitted:2016-10-12 14:36:00

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;
typedef struct Edge {
    int u, v, w, next;
}Edge;
const int inf = 0x7f7f7f7f;
const int maxn = 500;
int cnt, dhead[maxn];
int cur[maxn], dd[maxn];
Edge dedge[maxn*maxn];
int S, T, N;
int n, m;
void init() {
    memset(dhead, -1, sizeof(dhead));
    for(int i = 0; i < maxn; i++) dedge[i].next = -1;
    cnt = 0;
}
void adde(int u, int v, int w, int c1) {
    dedge[cnt].u = u; dedge[cnt].v = v; dedge[cnt].w = w; 
    dedge[cnt].next = dhead[u]; dhead[u] = cnt++;
    dedge[cnt].u = v; dedge[cnt].v = u; dedge[cnt].w = c1; 
    dedge[cnt].next = dhead[v]; dhead[v] = cnt++;
}
bool bfs(int s, int t, int n) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX