제출 #23280

#제출 시각아이디문제언어결과실행 시간메모리
23280repeatingGap (APIO16_gap)C++11
컴파일 에러
0 ms0 KiB
#define ll long long const long long INF = 2e9; long long MOD = 1e9+7; void MinMax(ll ,ll ,long long &,long long &); void MinMax(ll s,ll t,long long &mn,long long &mx){ // cout<<s<<" "<<t<<endl; // cin>>mn>>mx; } long long findGap(int,int); long long findGap(int t,int n){ ll l=0,r=1e18; vector<ll> v; ll res=0; ll l1=1e18,r1=0; while(l<r){ MinMax(l+1,r-1,l,r); if(l!=-1)v.push_back(l); if(r!=-1)v.push_back(r); if(r!=-1)res=max(res,max(r1-r,l-l1)); if(l==-1)res=max(res,r1-l1); r1=r,l1=l; if(l==-1)break; } return res; } //int main(){ // cout<<findGap(1,4); //}

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:12:5: error: 'vector' was not declared in this scope
     vector<ll> v;
     ^
gap.cpp:1:12: error: expected primary-expression before 'long'
 #define ll long long
            ^
gap.cpp:12:12: note: in expansion of macro 'll'
     vector<ll> v;
            ^
gap.cpp:17:18: error: 'v' was not declared in this scope
         if(l!=-1)v.push_back(l);
                  ^
gap.cpp:18:18: error: 'v' was not declared in this scope
         if(r!=-1)v.push_back(r);
                  ^
gap.cpp:19:43: error: 'max' was not declared in this scope
         if(r!=-1)res=max(res,max(r1-r,l-l1));
                                           ^
gap.cpp:19:44: error: 'max' was not declared in this scope
         if(r!=-1)res=max(res,max(r1-r,l-l1));
                                            ^
gap.cpp:19:44: error: redeclaration of '<typeprefixerror>max'
gap.cpp:19:43: note: previous declaration '<typeprefixerror>max'
         if(r!=-1)res=max(res,max(r1-r,l-l1));
                                           ^
gap.cpp:20:35: error: 'max' was not declared in this scope
         if(l==-1)res=max(res,r1-l1);
                                   ^