Submission #23022

# Submission time Handle Problem Language Result Execution time Memory
23022 2017-05-01T22:13:51 Z arman_ferdous Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
const long long MAXN = 1e18;
long long findGap(int, int);
void MinMax(long long , long long , long long *, long long *)
  
long long findGap(int T, int N)
{
    long long mmin, mmax;
    MinMax(0LL,MAXN,&mmin,&mmax);
    long long gap = (mmax-mmin-1)/(N-1), res = -1;
    long long L = mmin+1, prevMax = mmin;
    while(L+gap<=mmax)
    {
        long long curMin, curMax;
        MinMax(L,L+gap,&curMin,&curMax);
        if(curMin != -1 && curMax != -1)
        {
            long long curDiff = curMin - prevMax;
            res = (curDiff > res ? curDiff : res);
            prevMax = curMax;
        }
        L += gap+1;
    }
    return res;
}

Compilation message

gap.cpp:5:1: error: expected initializer before 'long'
 long long findGap(int T, int N)
 ^