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 "gap.h"
#include <bits/stdc++.h>
using namespace std;
long long findGap(int t, int n)
{
if(t == 1)
{
vector<long long> l, r;
long long st=0, dr=1e18;
while(n)
{
MinMax(st, dr, &st, &dr);
if(st == dr)
{
l.push_back(st);
break;
n--;
}
l.push_back(st);
r.push_back(dr);
st++;
dr--;
n-=2;
}
while(!r.empty())
{
l.push_back(r.back());
r.pop_back();
}
/*
for(long long it : l)
cout<<it<<' ';
cout<<'\n';
*/
long long ans=0;
for(int i=1;i<(int)l.size();i++)
ans=max(ans, l[i] - l[i-1]);
return ans;
}
else
{
if(n == 4)
return 3;
exit(1);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |