Submission #23276

# Submission time Handle Problem Language Result Execution time Memory
23276 2017-05-05T22:05:32 Z repeating Gap (APIO16_gap) C++11
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define F first
#define S second
#define P push
#define pb push_back
#define MEM(dp,i) memset(dp,i,sizeof(dp))
#define W while
#define R return
#define C continue
#define SI size()
#define ll long long
#define pll pair<ll,ll>
#define SF(x) scanf("%I64d",&x)

using namespace std;
const long long INF = 2e9;
long long MOD = 1e9+7;
void MinMax(ll ,ll ,long long &,long long &);
long long findGap(int,int);
long long findGap(int t,int n){
    ll l=0,r=1e18;
    vector<ll> v;
    W(l+1<r){
        MinMax(l+1,r-1,l,r);
        v.pb(l);
        v.pb(r);
        if(l==-1)break;
    }
    sort(v.begin(),v.end());
    ll res=0;
    for(int i=1;i<v.SI;i++){
        res=max(res,v[i]-v[i-1]);
    }
    R res;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:31:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=1;i<v.SI;i++){
                  ^
/tmp/ccKJZChm.o: In function `findGap(int, int)':
gap.cpp:(.text+0x27d): undefined reference to `MinMax(long long, long long, long long&, long long&)'
collect2: error: ld returned 1 exit status