# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313137 | nandonathaniel | Gap (APIO16_gap) | C++14 | 61 ms | 2736 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> kiri,kanan;
long long ki=0,ka=1e18,mn,mx;
for(int i=1;i<=(N+1)/2;i++){
MinMax(ki,ka,&mn,&mx);
kiri.push_back(mn);
if(mn!=mx)kanan.push_back(mx);
ki=mn+1;ka=mx-1;
}
reverse(kanan.begin(),kanan.end());
for(auto isi : kanan)kiri.push_back(isi);
// for(auto isi : kiri)cout << isi << " ";
// cout << '\n';
long long ans=0;
for(int i=1;i<kiri.size();i++)ans=max(ans,kiri[i]-kiri[i-1]);
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |