Submission #330818

#TimeUsernameProblemLanguageResultExecution timeMemory
330818Sho10Gap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long
#include "gap.h"
#define double long double
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod (10*10*10*10*10*10*10*10*10+7)
#define PI 3.14159265359
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005ll
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll v[100005];
int findGap(int t,int n){
if(t==1){
 ll l=1,r=n,a=0,b=1e18;
while(l<=r){
    MinMax(a,b,&a,&b);
    v[l++]=a++;
    v[r--]=b--;
}
ll ans=0;
for(ll i=2;i<=n;i++)
{
    ans=max(ans,v[i]-v[i-1]);
}
return ans;
}else {
ll a,b,ans=0;
minMax(0,1e18,&a,&b);
if(b-a+1==n){
    return 1;
}
ll nr=(b-a-1)/(n-1);
ll last=a;
ll x,y;
for(ll i=a+1;i<=b-1;i+=nr+1){
    MinMax(i,i+nr,&x,&y);
    if(x!=-1){
        ans=ans(res,x-last);
    }
    if(y!=-1){
        last=y;
    }
}
return max(ans,b-last);
}
}
/*
int32_t main(){
CODE_START;
*/

Compilation message (stderr)

gap.cpp: In function 'int findGap(int, int)':
gap.cpp:39:1: error: 'minMax' was not declared in this scope; did you mean 'MinMax'?
   39 | minMax(0,1e18,&a,&b);
      | ^~~~~~
      | MinMax
gap.cpp:49:17: error: 'res' was not declared in this scope
   49 |         ans=ans(res,x-last);
      |                 ^~~
gap.cpp:49:27: error: 'ans' cannot be used as a function
   49 |         ans=ans(res,x-last);
      |                           ^