답안 #23280

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
23280 2017-05-05T22:21:08 Z repeating Gap (APIO16_gap) C++11
컴파일 오류
0 ms 0 KB
#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);
//}

Compilation message

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);
                                   ^