Submission #76380

# Submission time Handle Problem Language Result Execution time Memory
76380 2018-09-13T08:55:27 Z vex Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include<gap.h>
#define maxn 100005
#define INF 1e18 + 1000
using namespace std;

int n;
long long a[maxn];

long long findGap(int t,int n)
{
    if(t==1)
    {
        int br=1,mn,mx;
        a[0]=0;
        a[n+1]=INF;
        while(br<=(n+1)/2)
        {
            MinMax(a[br-1]+1,a[n+2-br]-1,&mn,&mx);
            a[br]=mn;
            a[n+1-br]=mx;
            br++;
        }
        
        long long sol=0;
        for(int i=1;i<n;i++)
        {
            if(a[i+1]-a[i]>sol)sol=a[i+1]-a[i];
        }
        return sol;
    }
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:19:49: error: cannot convert 'int*' to 'long long int*' for argument '3' to 'void MinMax(long long int, long long int, long long int*, long long int*)'
             MinMax(a[br-1]+1,a[n+2-br]-1,&mn,&mx);
                                                 ^
gap.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^