제출 #990669

#제출 시각아이디문제언어결과실행 시간메모리
990669Ibrohim0704사이버랜드 (APIO23_cyberland)C++17
컴파일 에러
0 ms0 KiB
#include <vector> #include <queue> #include <algorithm> using namespace std; typedef long long int; double solve(int N, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) { vector<double> min_time(N, numeric_limits<double>::infinity()); min_time[0] = 0; // Custom comparator for the priority queue auto cmp = [](const pair<double, int>& a, const pair<double, int>& b) { return a.first > b.first; }; priority_queue<pair<double, int>, vector<pair<double, int>>, decltype(cmp)> pq(cmp); pq.push({0, 0}); while (!pq.empty()) { double time = pq.top().first; int country = pq.top().second; pq.pop(); if (country == H) { return time; } for (int i = 0; i < M; ++i) { int neighbor; if (x[i] == country) { neighbor = y[i]; } else if (y[i] == country) { neighbor = x[i]; } else { continue; } double neighbor_time = time + c[i]; if (arr[neighbor] == 2 && K > 0) { neighbor_time /= 2; --K; } if (neighbor_time < min_time[neighbor]) { min_time[neighbor] = neighbor_time; pq.push({neighbor_time, neighbor}); } } } return -1; }

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

cyberland.cpp:7:19: error: declaration does not declare anything [-fpermissive]
    7 | typedef long long int;
      |                   ^~~