답안 #394281

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
394281 2021-04-26T10:51:08 Z irmuun 자매 도시 (APIO20_swap) C++17
컴파일 오류
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 | }
      | ^