hiho week 179 register

Ended

Participants:219

Verdict:Accepted
Score:100 / 100
Submitted:2017-12-05 20:33:34

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;
int n, m, q, ans = 0;
vector<pair<int, int> >G[10005];
int d[10005], f[(1<<20)+5][25], dist[10005][10005], inque[10005];
bool vis[(1<<20)+5][25], check[(1<<20)+5];
struct node{
    int L, S, E, T, C;
    node(){}
    node(int l, int s, int e, int t, int c){
        L = l, S = s, E = e, T = t, C = c;
    }
}Q[25];
void spfa(int u){
    memset(inque, 0, sizeof inque);
    memset(d, 0x3f3f3f3f, sizeof d);
    d[u] = 0;
    queue<int>q;
    q.push(u);
    inque[u] = 1;
    while(!q.empty()){
        int now = q.front(); q.pop();
        inque[now] = 0;
        for(int i = 0; i < G[now].size(); ++i){
            int v = G[now][i].first, w = G[now][i].second;
            if(d[now] + w < d[v]){
                d[v] = d[now] + w;
                if(!inque[v]){
                    q.push(v);
                    inque[v] = 1;
                }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX