제출 #1257224

#제출 시각아이디문제언어결과실행 시간메모리
1257224MasterDebaterGap (APIO16_gap)C++20
컴파일 에러
0 ms0 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; #define ll long long const int N=1e5+10; const ll MAXN=1e18; ll ans,a[N]; ll findGap(int T,int N){ if(T==1){ ll li=1,ri=N; a[N+1]=MAXN+1; a[0]=-1; while(ri-li>=0){ MinMax(a[li-1]+1,a[ri+1]-1,&a[li],&a[ri]); li++,ri--; } sort(a,a+N); for(int i=1;i<N;i++)ans=max(ans,a[i+1]-a[i]); } else{ ll mn,mx; MinMax(1,MAXN,&mn,&mx); ll x=(mx-mn+N-2)/(N-1); ans=x; l,r,p=mn,i; for(i=mn;i+x<mx;i+=x+1){ MinMax(i,i+x,&l,&r); if(l!=-1)ans=max(ans,l-p),p=r; } MinMax(i,mx,&l,&r); if(l!=-1)ans=max(ans,l-p); } return ans; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:25:17: error: 'l' was not declared in this scope
   25 |                 l,r,p=mn,i;
      |                 ^
gap.cpp:25:19: error: 'r' was not declared in this scope
   25 |                 l,r,p=mn,i;
      |                   ^
gap.cpp:25:21: error: 'p' was not declared in this scope
   25 |                 l,r,p=mn,i;
      |                     ^
gap.cpp:25:26: error: 'i' was not declared in this scope
   25 |                 l,r,p=mn,i;
      |                          ^