| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 106165 | daniel920712 | Gap (APIO16_gap) | C++14 | 91 ms | 3832 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <algorithm>
#include "gap.h"
using namespace std;
long long all[100005];
long long findGap(int T,int N)
{
long long a,b,l=0,r=N-1,x=0,y=1000000000000000000 ,ans=0,c,d,t,i;
if(T==2)
{
MinMax(x,y,&a,&b);
x=(b-a)/(N-1)+1;
t=a;
for(;a<=b;a+=x,a++)
{
l=a;
r=min(b,a+x);
MinMax(l,r,&c,&d);
ans=max(ans,d-c);
if(c!=-1)
{
ans=max(ans,c-t);
t=d;
}
}
}
else
{
while(l<=r)
{
MinMax(x,y,&a,&b);
all[l]=a;
all[r]=b;
x=a+1;
y=b-1;
l++;
r--;
}
for(i=1;i<N;i++) ans=max(ans,all[i]-all[i-1]);
}
return ans;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
