Submission #308821

# Submission time Handle Problem Language Result Execution time Memory
308821 2020-10-02T04:17:35 Z juggernaut Crocodile's Underground City (IOI11_crocodile) C++14
Compilation error
0 ms 0 KB
#include"crocodile.h"
#include<bits/stdc++.h>
#define fr first
#define sc second
using namespace std;
vector<pair<int,int>>g[100005];
pair<int,int>a[100005];
int inf=1e9;
int travel_plan(int n,int m,int r[][2],int l[],int k,int p[]){
    for(int i=0;i<n;i++)a[i]={inf,inf};
    priority_queue<pair<int,int>>q;
    for(int i=0;i<m;i++){
        g[r[i][0]].push_back({r[i][1],l[i]});
        g[r[i][1]].push_back({r[i][0],l[i]});
    }
    for(int i=0;i<k;i++)
        q.push({0,p[i]}),a[p[i]]={0,0};
    while(!q.empty()){
        int len=-q.top().fr;
        int v=q.top().sc;
        q.pop();
        if(len>a[v].sc)continue;
        for(auto to:g[v])
            if(a[to.fr].sc>len+to.sc){
                a[to.fr].sc=len+to.sc;
                if(a[to.fr].fr>a[to.fr].sc)swap(a[to.fr].fr,a[to.fr].sc);
                if(a[to.fr].sc<inf)q.push({-a[to.fr].sc,to.fr});
            }
    }
    return a[0].sc;
}
#include"grader.cpp"

Compilation message

/tmp/ccrozhRK.o: In function `read_input()':
grader.cpp:(.text+0x0): multiple definition of `read_input()'
/tmp/ccdjQNqT.o:crocodile.cpp:(.text+0x30): first defined here
/tmp/ccrozhRK.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccdjQNqT.o:crocodile.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status