제출 #884512

#제출 시각아이디문제언어결과실행 시간메모리
884512Trisanu_DasCyberland (APIO23_cyberland)C++17
컴파일 에러
0 ms0 KiB
#include "cyberland.h"
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
 
const double INF = 1e18;
 
double solve(int N, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) {
	vector<double> dist(N, INF);
	vector<vector<pair<int,int>>> adj(N);
	for (int i = 0; i < M; ++i) {
		adj[x[i]].push_back({y[i], c[i]});
		adj[y[i]].push_back({x[i], c[i]});
	}
	priority_queue<pair<double,int>, vector<pair<double,int>>, greater<pair<double,int>>> pq;
	arr[0] = 0;
	pq.push({0, H});
	while(!pq.empty()) {
		int cur = pq.top().second;
		double d = pq.top().first;
		pq.pop();
		if (dist[cur] < d) continue;
		dist[cur] = d;
		if (arr[cur] == 0) return d;
		for (auto [nxt, cost] : adj[cur]) {
			if (dist[nxt] > d + cost) {
				dist[nxt] = d + cost;
				pq.push({dist[nxt], nxt});
			}
		}
	}o
	return -1;
 
}

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

cyberland.cpp: In function 'double solve(int, int, int, int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
cyberland.cpp:32:3: error: 'o' was not declared in this scope
   32 |  }o
      |   ^
cyberland.cpp:10:28: warning: control reaches end of non-void function [-Wreturn-type]
   10 |  vector<double> dist(N, INF);
      |                            ^