답안 #95694

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
95694 2019-02-02T07:45:25 Z ShaneOng Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
long long findGap(int T, int n){
    long long ans=0ll;
    //if(T==1){
        long long l=0ll,r=1000000000000000000ll;
        MinMax(l,r,&l,&r);
        int temp=2;
        for(int x=0;temp<n;x++){
            long long newl=-1ll,newr=-1ll;
            if(l+1ll<r-1ll)
                MinMax(l+1ll,r-1ll,&newl,&newr);
            if(newl!=-1ll){
                ans=max(ans,max(l-newl,r-newr));
                l=newl;
                r=newr;
            }
            temp+=2;
        }
    //}
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:5:9: error: 'MinMax' was not declared in this scope
         MinMax(l,r,&l,&r);
         ^~~~~~
gap.cpp:12:29: error: 'max' was not declared in this scope
                 ans=max(ans,max(l-newl,r-newr));
                             ^~~
gap.cpp:12:21: error: 'max' was not declared in this scope
                 ans=max(ans,max(l-newl,r-newr));
                     ^~~