Submission #561203

#TimeUsernameProblemLanguageResultExecution timeMemory
561203fdnfksdGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "gap.h" using namespace std; using ll = long long; ll a[100009]; ll findGap(int t, int n) { ll res=0; if(t==1) { a[0]=-1; a[n+1]=2e18+10; ll i=1,j=n; while(i<=j) { MinMax(a[i-1]+1,a[j+1]-1,&a[i],&a[j]); i++; j--; } for(int i=2;i<=n;i++) res=max(res,a[i]-a[i-1]); return res; } MinMax(-1,2e18,&a[1],&a[n]); ll dis=(a[n]-a[1])/(n-1); ll prev=-1, now=-1; for(int i=a[1];i<=a[n];i+=dis) { MinMax(i,i+dis,&tmp,&now); if(tmp==-1) continue; if(prev!=-1) { res=max(res,tmp-prev); } prev=now; } return res; }/* int main() { findGap(); }*/

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:29:25: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   29 |         MinMax(i,i+dis,&tmp,&now);
      |                         ^~~
      |                         tm