hiho week 25 register

Ended

Participants:726

Verdict:Accepted
Score:100 / 100
Submitted:2014-12-25 20:12:36

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<algorithm>
#include<queue>
#define V 100005
#define E 2000005
using namespace std;
int tot,n,m,len[E],fst[V],nxt[E],v[E],f[V],s,t;
bool inq[V];
queue<int>q;
void build(int x,int y,int z)
{
    v[tot]=y;
    len[tot]=z;
    nxt[tot]=fst[x];
    fst[x]=tot++;
}
void input()
{
    int x,y,z;
    
    scanf("%d%d%d%d",&n,&m,&s,&t);
    memset(fst,-1,sizeof(fst));
    while (m--)
    {
        scanf("%d%d%d",&x,&y,&z);
        build(x,y,z);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX