Submission #101635

#TimeUsernameProblemLanguageResultExecution timeMemory
101635asifthegreatGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long #define all(a) a.begin(),a.end() using namespace std; vector<int>v; long long findGap(int32_t T,int32_t n) { v.clear(); if(T == 1){ int s = 0,t = 1000000000000000001,mn,mx,sz = 0; while(1){ if(sz >= n)break; MinMax(s,t,&mn,&mx); v.push_back(mn); if(mn != mx){v.push_back(mx);sz++;} s = mn+1; t = mx-1; sz++; } sort(all(v)); int ans = -1; for(int i = 1; i < n;i++){ ans = max(ans,v[i]-v[i-1]); } return ans; } else return 0; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int32_t, int32_t)':
gap.cpp:16:4: error: 'MinMax' was not declared in this scope
    MinMax(s,t,&mn,&mx);
    ^~~~~~
gap.cpp:16:4: note: suggested alternative: 'rindex'
    MinMax(s,t,&mn,&mx);
    ^~~~~~
    rindex