Submission #560908

#TimeUsernameProblemLanguageResultExecution timeMemory
560908karriganGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define fastio ios_base::sync_with_stdio(false);cin.tie(nullptr); #include "gap.h" using namespace std; const int maxn=1e6; using ll=long long int; long long a[100009]; long long findGap(int t, int n){ if (t==1){ a[0]=-1; a[n+1]=2e18; for (int i=1,j=n;i<=j;i++,j--){ MinMax(a[i-1]+1, a[j+1]-1, &a[i], &a[j]); } long long ans=-1; for (int i=2;i<=n;i++){ ans=max(ans,a[i]-a[i-1]); } return ans; } else { MinMax(0,1e18,&a[1],&a[n]); long long l,r; MinMax(a[1],a[1]+(a[n]-a[1])/(n-1),&l,&r); long long temp=(a[n]-a[1])/(n-1); long long ans=-1; for (long long ret=r+1;ret+temp<=a[n];){ long long mn,mx; MinMax(ret,rep+temp,&mn,&mx); ans=max(ans,mn-r); l=mn,r=mx; ret=r+1; } return ans; } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:29:24: error: 'rep' was not declared in this scope; did you mean 'ret'?
   29 |             MinMax(ret,rep+temp,&mn,&mx);
      |                        ^~~
      |                        ret