Submission #394281

# Submission time Handle Problem Language Result Execution time Memory
394281 2021-04-26T10:51:08 Z irmuun Swapping Cities (APIO20_swap) C++17
Compilation error
0 ms 0 KB
#include "swap.h"
#include<bits/stdc++.h>
using namespace std;
int ans=0,i;
void init(int N, int M, vector<int> U, vector<int> V, vector<int> W) {
	ans=W[0];
  	for(i=0;i<M;i++){
      	ans=max(ans,W[i]);
    }
}
int getMinimumFuelCapacity(int X, int Y) {
  	if(M+1==N){
      	return 0;
    }
  	else{
      	return ans;
    }
}

Compilation message

swap.cpp: In function 'int getMinimumFuelCapacity(int, int)':
swap.cpp:12:7: error: 'M' was not declared in this scope
   12 |    if(M+1==N){
      |       ^
swap.cpp:12:12: error: 'N' was not declared in this scope
   12 |    if(M+1==N){
      |            ^
swap.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^