| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 532780 | new_acc | Gap (APIO16_gap) | C++14 | 39 ms | 1144 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>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=1e3+10;
ll solve1(int n){
ll mn,mx;
ll curr1=0,curr2=1e18,last1=-1,last2=-1;
ll res=0;
for(int i=1;i<=(n+1)/2;i++){
MinMax(curr1,curr2,&mn,&mx);
if(last1!=-1) res=max({res,curr1-last1,last2-curr2});
last1=curr1,last2=curr2;
curr1=mn+1,curr2=mx-1;
}
return (n%2==0?max(res,last2-last1):res);
}
ll findGap(int xd,int n){
if(xd==1) return solve1(n);
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
