Submission #628203

# Submission time Handle Problem Language Result Execution time Memory
628203 2022-08-13T08:04:07 Z abcvuitunggio Crocodile's Underground City (IOI11_crocodile) C++17
Compilation error
0 ms 0 KB
#include "crocodile.h"
#include <bits/stdc++.h>
#define int long long
using namespace std;
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]){
    int INF=1e18,d[N][2];
    vector <pair <int, int> > ke[N];
    priority_queue<pair <int, int>, vector <pair <int, int> >, greater <pair <int, int> > > q;
    for (int i=0;i<M;i++)
        for (int j=0;j<2;j++)
            ke[R[i][j]].push_back({R[i][j^1],L[i]});
    for (int i=0;i<N;i++)
        d[i][0]=d[i][1]=INF;
    for (int i=0;i<K;i++){
        q.push({0,P[i]});
        d[P[i]][0]=d[P[i]][1]=0;
    }
    while (!q.empty()){
        int u=q.top().first,du=q.top().second;
        q.pop();
        if (du!=d[u][0])
            continue;
        for (auto [v,w]:ke[u]){
            if (d[u][0]>d[v][1]+w){
                d[u][1]=d[u][0];
                d[u][0]=d[v][1]+w;
                q.push({d[u][0],u});
            }
            else if (d[u][1]>d[v][1]+w)
                d[u][1]=d[v][1]+w;
        }
    }
    return d[0][1];
}

Compilation message

/usr/bin/ld: /tmp/cc3NRM5F.o: in function `main':
grader.cpp:(.text.startup+0x36): undefined reference to `travel_plan(int, int, int (*) [2], int*, int, int*)'
collect2: error: ld returned 1 exit status