Submission #394281

#TimeUsernameProblemLanguageResultExecution timeMemory
394281irmuunSwapping Cities (APIO20_swap)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

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 | }
      | ^