# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
560225 | Trisanu_Das | Gap (APIO16_gap) | C++17 | 49 ms | 1088 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 "gap.h"
#define ll long long int
using namespace std;
ll findGap(int type, int n){
ll ma, mi, ans;
MinMax(0, 2e18, &mi, &ma);
if(type == 1){
for(int i = 1; i < (n + 1) / 2; ++i){
ll currma, currmi;
MinMax(mi + 1, ma - 1, &currmi, &currma);
ans = max(ans, max(currmi - mi, ma - currma));
mi = currmi; ma = currma;
}
return ans = max(ans, ma - mi);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |