제출 #394281

#제출 시각아이디문제언어결과실행 시간메모리
394281irmuun자매 도시 (APIO20_swap)C++17
컴파일 에러
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; } }

컴파일 시 표준 에러 (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 | }
      | ^