This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
vector<long long> v;
long long findGap(int m, int n)
{
long long s = -1, t = 2e18, mn, mx, ans = 0;
if(m == 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());
n = v.size();
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:30:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |