# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1015135 | vjudge1 | Gap (APIO16_gap) | C++17 | 49 ms | 7020 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 <bits/stdc++.h>
// #include "grader.cpp"
#include "gap.h"
using namespace std;
typedef long long ll;
ll findGap(int T, int N){
if (T == 1){
set<ll> st;
ll mn = 0, mx = 1e18;
while (N > 0){
N -= 2;
MinMax(mn, mx, &mn, &mx);
st.insert(mn);
st.insert(mx);
mn++;
mx--;
}
vector<ll> vec;
for (ll x : st)
vec.push_back(x);
ll res = 0;
for (int i = 1; i < vec.size(); i ++)
res = max(res, vec[i] - vec[i - 1]);
return res;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |