제출 #755371

#제출 시각아이디문제언어결과실행 시간메모리
755371IloveN사이버랜드 (APIO23_cyberland)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb push_back #define eb emplace_back #define all(vr) vr.begin(), vr.end() using ll = long long; using ld = long double; using pii = pair<int, int>; using vi = vector<int>; using vl = vector<ll>; struct vertex { int v, d; double dist; bool operator < (const vertex &obj) const { return (d > obj.d || (d == obj.d && (dist > obj.dist || (dist == obj.dist && v > obj.v)))); } }; const int N = 1e5 + 10; vector<pii> G[N]; int vis[N]; double dist[N][82]; void dfs(int u, vi& vt, int del) { vis[u] = 1; vt.eb(u); for (pii pa : G[u]) if (!vis[pa.fi] && pa.fi != del) dfs(pa.fi, vt, del); } double solve(int n, int m, int k, int h, vi x, vi y, vi c, vi arr) { k = min(k, 80); for (int i = 0; i < n; ++i) G[i].clear(); for (int i = 0; i < m; ++i) { int u = x[i], v = y[i], w = c[i]; G[u].eb(v, w); G[v].eb(u, w); } for (int i = 0; i < n; ++i) vis[i] = 0; vi vt; dfs(0, vt, h); priority_queue<vertex> q; for (int i = 0; i < n; ++i) for (int j = 0; j <= k; ++j) dist[i][j] = 1e18; dist[0][0] = 0; q.push({0, 0, 0}); for (int x : vt) if (!arr[x]) dist[x][0] = 0, q.push({x, 0, 0}); while (!q.empty()) { int u = q.top().v, d = q.top().d; double w = q.top().dist; q.pop(); if (w != dist[u][d] || u == h) continue; for (pii pa : G[u]) { if (dist[u][d] + pa.se < dist[pa.fi][d]) { dist[pa.fi][d] = dist[u][d] + pa.se; q.push({pa.fi, d, dist[pa.fi][d]}); } if (arr[u] == 2 && d < k && dist[u][d] / 2 + pa.se < dist[pa.fi][d + 1]) { dist[pa.fi][d + 1] = dist[u][d] / 2 + pa.se; q.push({pa.fi, d + 1, dist[pa.fi][d + 1]}); } } } double res = 1e18; for (int i = 0; i <= k; ++i) res = min(res, dist[h][i]); if (res == 1e18) res = -1; return res; } int main() { //freopen("ss.inp", "r", stdin); ios::sync_with_stdio(false); cin.tie(0); return 0; }

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

/usr/bin/ld: /tmp/ccl9daEj.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccHS2Mfi.o:cyberland.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status