제출 #1146140

#제출 시각아이디문제언어결과실행 시간메모리
1146140hoangnoobproGap (APIO16_gap)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define nmax 300007
#define fi first
#define se second
#define ll long long
long long findGap(ll T,ll N)
{
    ll kq=0,x=0,y=1e18,a[100007],j,k;
    
    if(T==1)
    {
        MinMax(x,y,&a[1],&a[n]);
        j=2;
        k=n-1;
        while(j<=k)
        {
            MinMax(a[j-1],a[k+1],&a[j],&a[k]);
            j++;
            k--;
        }
        for(int i=2;i<=n;++i)kq=max(kq,a[i]-a[i-1]);
    }
    return kq;
}

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:13:29: error: 'n' was not declared in this scope
   13 |         MinMax(x,y,&a[1],&a[n]);
      |                             ^
gap.cpp:13:9: error: 'MinMax' was not declared in this scope; did you mean 'nmax'?
   13 |         MinMax(x,y,&a[1],&a[n]);
      |         ^~~~~~
      |         nmax