# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
240373 | Dremix10 | Gap (APIO16_gap) | C++17 | 70 ms | 2392 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;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define F first
#define S second
#define endl '\n'
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define maxp 22
#define EPS (ld)(1e-18)
#define mod (int)(1e9+7)
//#define N (int)(1e5+1)
long long findGap(int T, int N){
int i;
vector<ll> arr;
ll limit=(N+1)/2;
ll l=1,r=1e18+1;
while(arr.size()<N){
ll mini,maxi;
ll* p1 = &mini;
ll* p2 = &maxi;
MinMax(l,r,p1,p2);
arr.push_back(mini);
arr.push_back(maxi);
l=mini+1;
r=maxi-1;
}
sort(arr.begin(),arr.end());
ll ans=0;
for(i=0;i<N-1;i++)
ans=max(ans,arr[i+1]-arr[i]);
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |