# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
713109 | Vu_CG_Coder | Gap (APIO16_gap) | C++14 | 58 ms | 2240 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 <stdio.h>
#include <stdlib.h>
#include <vector>
#include <bits/stdc++.h>
#include "gap.h"
#define ll long long
using namespace std;
long long findGap(int t , int n)
{
long long l = 0 , r = 1e18;
vector <long long> kq;
for (int i = 1 ; i <= (n + 1)/2 ; i++)
{
ll s , t;
MinMax(l,r,&s,&t);
kq.push_back(s);
kq.push_back(t);
l = (s) + 1;
r = (t) - 1;
}
sort(kq.begin(),kq.end());
long long res = 0;
for (int i = 1 ; i < kq.size() ; i++)
res = max(res,kq[i] - kq[i - 1]);
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |