Submission #671087

#TimeUsernameProblemLanguageResultExecution timeMemory
671087AdamGSGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; const ll INF=1e18; ll findGap(int t, int n) { ll mi, ma; MinMax(0, INF, &mi, &ma); ll x=(*ma-*mi+n-1)/(n-1), ans=x; ll lst=mi; for(ll i=mi; i<ma; i+=x+1) { ll a, b; MinMax(i, i+x, &a, &b); if(a==-1) continue; ans=max(ans, a-lst); lst=b; } return ans; }

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:9:15: error: invalid type argument of unary '*' (have 'll' {aka 'long long int'})
    9 |         ll x=(*ma-*mi+n-1)/(n-1), ans=x;
      |               ^~~
gap.cpp:9:19: error: invalid type argument of unary '*' (have 'll' {aka 'long long int'})
    9 |         ll x=(*ma-*mi+n-1)/(n-1), ans=x;
      |                   ^~~
gap.cpp:15:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |                 ans=max(ans, a-lst);
      |                 ^~~
      |                 abs
gap.cpp:18:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         return ans;
      |                ^~~
      |                abs