# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
200700 | Rakhmand | Gap (APIO16_gap) | C++14 | 77 ms | 2140 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 <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <iterator>
using namespace std;
long long a[100010];
long long findGap(int T, int N)
{
if(T == 1){
int L = 1, R = N;
long long l = 0, r = 1e18;
while(R >= L){
long long mn = NULL, mx = NULL;
//cout << L << ' ' << R << ' ' << l << ' ' << r << endl;
MinMax(l, r, &mn, &mx);
//cout << mn << ' ' << mx << endl;
a[L++] = mn;
a[R--] = mx;
l = mn + 1;
r = mx - 1;
}
long long ans = 0;
for(int i = 1; i < N; i++){
std::cout << a[i] << ' ';
if(a[i + 1] - a[i] > ans){
ans = a[i + 1] - a[i];
}
}
return ans;
}else{
return 0;
//i don't know
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |