Submission #89993

#TimeUsernameProblemLanguageResultExecution timeMemory
89993thebesFerries (NOI13_ferries)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int MN = 1e5+5; int i, x, y, dist[MN], idx[MN]; vector<int> adj[MN], w[MN]; typedef pair<int,int> pii; struct pq{bool operator()(const pii&i,const pii&j){return i.second>j.second;}}; priority_queue<pii,vector<pii>,pq> q; int ferries(int N,int M,int *A,int *B,int *C){ for(i=0;i<M;i++){ adj[B[i]].push_back(A[i]); w[A[i]].push_back(C[i]); } for(i=1;i<=N;i++) sort(w[i].begin(),w[i].end(),[](int i,int j){return i>j;}); memset(dist,-1,sizeof(dist)); q.push({N,0}); while(q.size()){ auto v=q.top(); q.pop(); if(dist[v.first]!=-1) continue; else dist[v.first]=v.second; for(auto e : adj[v.first]){ if(dist[e]==-1){ int W = w[e][idx[e]]; idx[e]++; q.push({e, W+v.second}); } } } return dist[1]; }

Compilation message (stderr)

/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status