제출 #387170

#제출 시각아이디문제언어결과실행 시간메모리
387170talant117408자매 도시 (APIO20_swap)C++17
컴파일 에러
0 ms0 KiB
//~ #include "swap.h" #include "grader.cpp" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair <int, int> pii; typedef pair <ll, ll> pll; #define precision(n) fixed << setprecision(n) #define pb push_back #define ub upper_bound #define lb lower_bound #define mp make_pair #define eps (double)1e-9 #define PI 2*acos(0.0) #define endl "\n" #define sz(v) int((v).size()) #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() #define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define OK cout << "OK" << endl; const int N = 1e5+7; vector <pii> graph[N]; int mx; bool less3 = 1, less2 = 0; void init(int n, int m, vector<int> U, vector<int> V, vector<int> W) { for (int i = 0; i < m; i++) { graph[U[i]].pb(mp(V[i], W[i])); graph[V[i]].pb(mp(U[i], W[i])); } for (int i = 0; i < n; i++) { if (sz(graph[i]) > 2) less3 = 0; } if (less3) { for (int i = 0; i < n; i++) { if (sz(graph[i]) == 1) less2 = 1; } if (!less2) mx = *max_element(all(W)); } } int getMinimumFuelCapacity(int X, int Y) { if (less3) { if (less2) return -1; return mx; } }

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

swap.cpp: In function 'int getMinimumFuelCapacity(int, int)':
swap.cpp:51:1: warning: control reaches end of non-void function [-Wreturn-type]
   51 | }
      | ^
/tmp/ccmsIKLB.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccL6xnxJ.o:swap.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status