제출 #1196003

#제출 시각아이디문제언어결과실행 시간메모리
1196003hackstarGap (APIO16_gap)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define int long long int findGap(int t,int n){ vector<int>a(n); int l=0,r=1e18; int mn,mx; for(int i=0;i<n/2;i++){ MinMax(l,r,&mn,&mx); a[i]=l; a[n-i-1]=r; l=mn; r=mx; } int mx=0; for(int i=0;i<n-1;i++){ int cur=a[i+1]-a[i]; mx=max(mx,cur); } return mx; }

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

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:11:17: error: 'MinMax' was not declared in this scope
   11 |                 MinMax(l,r,&mn,&mx);
      |                 ^~~~~~
gap.cpp:17:13: error: redeclaration of 'long long int mx'
   17 |         int mx=0;
      |             ^~
gap.cpp:9:16: note: 'long long int mx' previously declared here
    9 |         int mn,mx;
      |                ^~