Submission #260788

#TimeUsernameProblemLanguageResultExecution timeMemory
260788T0p_Gap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; vector<long long> v; long long findGap(int t, int n) { long long s = -1, t = 2e18, mn, mx, ans = 0; if(t == 1) { while(s < t) { MinMax(s, t, &mn, &mx); v.push_back(mn); v.push_back(mx); s = mn + 1; t = mx - 1; } sort(v.begin(), v.end()); for(int i=1 ; i<n ; i++) ans = max(ans, v[i] - v[i-1]); return ans; } else { } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:8:20: error: declaration of 'long long int t' shadows a parameter
  long long s = -1, t = 2e18, mn, mx, ans = 0;
                    ^
gap.cpp:13:4: error: 'MinMax' was not declared in this scope
    MinMax(s, t, &mn, &mx);
    ^~~~~~
gap.cpp:13:4: note: suggested alternative: 'rindex'
    MinMax(s, t, &mn, &mx);
    ^~~~~~
    rindex
gap.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^