Submission #984084

#TimeUsernameProblemLanguageResultExecution timeMemory
984084RafiullahCyberland (APIO23_cyberland)C++17
Compilation error
0 ms0 KiB
#include "cyberland.h" #include <bits/stdc++.h> using namespace std; #define int long long double solve(int N, int M, int K, int H, std::vector<int> x, std::vector<int> y, std::vector<int> c, std::vector<int> arr) { int n ,m , k,h;cin>>n>>m>>k>>h; map<int,vector<int>> graph; map<pair<int,int>,int> weight; int A[n]; int dist[n]; for(int i = 0 ;i <n ;i ++){ dist[i] = 1e9; cin>>A[i]; } for(int i = 0 ;i<m ;i ++){ int a ,b,c;cin>>a>>b>>c; weight[{min(a,b),max(a,b)}] = c; graph[a].push_back(b); graph[b].push_back(a); } priority_queue<pair<int,int>> pq; dist[0]=0; pq.push({0,0}); while(pq.size()>0){ int node = pq.top().second; pq.pop(); // cout<<graph[node].size()<<endl; for(int child:graph[node]){ int W = weight[{min(node,child),max(node,child)}]; // cout<<node<<" "<<child<<" "<<W<<endl; if(dist[node]+W<dist[child]){ dist[child] = dist[node]+W; pq.push({-dist[child],child}); } } } if(dist[h] == 1e9)dist[h] = -1; return dist[h]; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc4k2R5e.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