# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
262143 | define | Gap (APIO16_gap) | C++17 | 85 ms | 1276 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#define ll long long
#include<iostream>
using namespace std;
template<class T>
inline bool chmax(T &a,T b){
if(a<b){a=b;return true;}
return false;
}
ll solve1(int N){
ll ans=0;
ll l=-1,r=1e18;r+=1;
for(int i=0;i<(N+1)/2;i++){
ll mn,mx;
MinMax(l+1,r-1,&mn,&mx);
if(i){
chmax(ans,mn-l);
chmax(ans,r-mx);
}
l=mn;
r=mx;
}
if(N%2==0)chmax(ans,r-l);
return ans;
}
ll solve2(int N){
ll mn,mx;
MinMax(0,1e18,&mn,&mx);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |