답안 #387170

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
387170 2021-04-08T05:50:42 Z talant117408 자매 도시 (APIO20_swap) C++17
컴파일 오류
0 ms 0 KB
//~ #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;
	}
}

Compilation message

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