hiho week 116 register

Ended

Participants:819

Verdict:Accepted
Score:100 / 100
Submitted:2016-09-23 21:28:41

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 <cstdlib>
#include <cstring>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
#define INF  0x3f3f3f3f
using namespace std;
struct Edge
{
    int to, val, next;
} edge[2000000];
int n, m, tot;
int head[20100], level[20100], cur[20100];
void add_edge(int from, int to, int val)
{
    edge[tot].to = to;
    edge[tot].val = val;
    edge[tot].next = head[from];
    head[from] = tot++;
    edge[tot].to = from;
    edge[tot].val = 0;
    edge[tot].next = head[to];
    head[to] = tot++;
}
int bfs(int s,int t)
{
    queue<int> que;
    que.push(s);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX