Submission #1059102

#TimeUsernameProblemLanguageResultExecution timeMemory
1059102vjudge1Cyberland (APIO23_cyberland)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; long long dist[100001]; void dijkstra(vector<pair<long long,long long>> adj[],long long i) { priority_queue<pair<long long,long long>> pq; pq.push({-0,i}); dist[i]=0; while(pq.size()>0) { long long a=-pq.top().first,b=pq.top().second; pq.pop(); for(auto it : adj[b]) { if(dist[it.first]==-1 || (dist[it.first]>a+it.second)) { dist[it.first]=dist[b]+it.second; pq.push({-dist[it.first],it.first}); } } } } double solve(long long N, long long M, long long K, long long H, std::vector<long long> x, std::vector<long long> y, std::vector<long long> c, std::vector<long long> arr) { memset(dist,-1,sizeof(dist)); vector<pair<long long,long long>> adj[N+1]; for(long long i=0;i<x.size();i++) { long long a=x[i],b=y[i],cc=c[i]; adj[a].push_back({b,cc}); adj[b].push_back({a,cc}); } dijkstra(adj,0); return dist[H]; }

Compilation message (stderr)

cyberland.cpp: In function 'double solve(long long int, long long int, long long int, long long int, std::vector<long long int>, std::vector<long long int>, std::vector<long long int>, std::vector<long long int>)':
cyberland.cpp:34:24: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |     for(long long i=0;i<x.size();i++)
      |                       ~^~~~~~~~~
/usr/bin/ld: /tmp/ccUiCU03.o: in function `main':
grader.cpp:(.text.startup+0x696): undefined reference to `solve(int, int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status