# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569037 | BadPenalty | Gap (APIO16_gap) | C++14 | 3097 ms | 2252 KiB |
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)
{
vector<long long>ll;
long long a = 0,b = 1e18,d;
MinMax(a,b,&a,&b);
ll.push_back(a);
a++;
while(ll.size()<N)
{
b = a+1;
MinMax(a,b,&b,&d);
if(b!=-1)
{
a = b;
ll.push_back(a);
}
a++;
}
long long ans = 0;
// for(int i = 0;i<N;i++)
// cout<<ll[i]<<' ';
// cout<<endl;
for(int i = 1;i<N;i++)
{
ans = max(ans,ll[i]-ll[i-1]);
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |