제출 #1152266

#제출 시각아이디문제언어결과실행 시간메모리
1152266itslqOdašiljači (COCI20_odasiljaci)C++20
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; #define int long long int main() { int N, M; cin >> N; vector<pair<int, int>> coords(N); for (int i = 0; i < N; i++) cin >> coords[i].first >> coords[i].second; vector<vector<int>> dist(N, vector<int>(N)); for (int i = 0; i < N; i++) { for (int j = 0; j < i; j++) { dist[i][j] = dist[j][i] = ((coords[i].first - coords[j].first) * (coords[i].first - coords[j].first) + (coords[i].second - coords[j].second) * (coords[i].second - coords[j].second)) / 4; } } int U = N; pair<int, int> curr; vector<bool> visited(N); priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; pq.emplace(0, 0); while (U) { curr = pq.top(); pq.pop(); if (visited[curr.second]) continue; visited[curr.second] = 1; M = max(M, curr.first); U--; for (int j = 0; j < N; j++) { if (!visited[j]) { pq.emplace(dist[curr.second][j], j); } } } cout << fixed << setprecision(8) << sqrt((double) M); }

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

cc1plus: error: '::main' must return 'int'