[Offer收割]编程练习赛4 register

Ended

Participants:899

Verdict:Accepted
Score:100 / 100
Submitted:2016-08-07 13:05:35

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 <iostream>
#include <vector>
#include <cstring>
#include <queue>
using namespace std;
int N, M, K, Q;
typedef struct{
    int f, t, next, w;
}Edge;
Edge edge[1000005];
int head[510000];
bool visit[510000];
int dist[510000];
int kNum;
void addedge(int f, int t, int w)
{
    edge[kNum].f = f;
    edge[kNum].t = t;
    edge[kNum].w = w;
    edge[kNum].next = head[f];
    head[f] = kNum ++;
    edge[kNum].f = t;
    edge[kNum].t = f;
    edge[kNum].w = w;
    edge[kNum].next = head[t];
    head[t] = kNum ++;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX