Submission #498979

# Submission time Handle Problem Language Result Execution time Memory
498979 2021-12-26T21:22:30 Z aymanrs Swapping Cities (APIO20_swap) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
int ans = 0;
void init(int N, int M, int U[], int V[], int W[]){
	int deg[N] = {0};
	for(int i = 0;i < M;i++) {
		deg[U[i]]++;
		deg[V[i]]++;
		ans = max(ans, W[i]);
	}
	for(int i = 0;i < N;i++){
		if(deg[i] == 1) ans = -1;
	}
}
int getMinimumFuelCapacity(int x, int y){
	return ans;
}
// int main(){
// 	init(3, 3, {1, 2, 3}, {2, 3, 1}, {4, 5, 2});
// 	cout << getMinimumFuelCapacity(1, 3) << '\n';
// }

Compilation message

/usr/bin/ld: /tmp/ccb6Mw2h.o: in function `main':
grader.cpp:(.text.startup+0x1c3): undefined reference to `init(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status