Submission #1323938

#TimeUsernameProblemLanguageResultExecution timeMemory
1323938aritro_Gap (APIO16_gap)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "gap.h"
using namespace std;

typedef long long ll;
#define int ll
#define pb push_back

//void MinMax(ll s,ll t,ll &mn,ll &mn);

ll findGap(int t,int n){
    ll l=-1,r=1e18 + 1;
    vector<int> ans;
    for(int i=0;i<=(n+1)/2;i++){
        MinMax(l+1,r-1,&l,&r);
        ans.pb(l);
        if(l!=r) ans.pb(r);
    }
    sort(ans.begin(),ans.end());
    int res=0;
    for(int i=0;i<n-1;i++) res=max(res,a[i+1]-a[i]);
    return res;
}

Compilation message (stderr)

gap.cpp: In function 'll findGap(ll, ll)':
gap.cpp:21:40: error: 'a' was not declared in this scope
   21 |     for(int i=0;i<n-1;i++) res=max(res,a[i+1]-a[i]);
      |                                        ^