제출 #752975

#제출 시각아이디문제언어결과실행 시간메모리
752975MohamedFaresNebili사이버랜드 (APIO23_cyberland)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll M = 20000000007; long double solve(ll n, ll m, ll k, ll h, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) { long double d[n]; d[0] = 0; for(int l = 1; l < n; l++) d[l] = M; vector<pair<int, int>> adj[n]; for(int l = 0; l < m; l++) { adj[x[l]].push_back({y[l], c[l]}); adj[y[l]].push_back({x[l], c[l]}); } priority_queue<pair<long double, int>, vector<pair<long double, int>>, greater<pair<long double, int>>> pq; pq.push({0, 0}); while(!pq.empty()) { long double w = pq.top().first; int u = pq.top().second; pq.pop(); for(auto v : adj[u]) { long double D = w + v.second; if(arr[v.first] == 0) D = 0; if(arr[v.first] == 2) D /= 2.0; if(d[v.first] > D) { d[v.first] = D; if(v.first != h) pq.push({d[v.first], v.first}); } } } if(d[h] == M) return -1; return d[h]; }

컴파일 시 표준 에러 (stderr) 메시지

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