제출 #536250

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5362502022-03-12 16:37:52DJ035Gap (APIO16_gap)C++17
88.67 / 100
56 ms1992 KiB
#include "gap.h"
#include <bits/stdc++.h>
long long findGap(int T, int N)
{
long long arr[111111];
long long mn, mx;
long long tmp;
long long maximum;
long long high=1e18, low=0;
if(T==1)
{
for(int i=1;i<=N/2;i++)
{
MinMax(low,high,&mn,&mx);
arr[i]=mn;
arr[N-i+1]=mx;
low=mn+1;
high=mx-1;
}
if(N%2==1)
{
MinMax(low,high,&mn,&mx);
arr[N/2+1]=mn;
}
long long answer=0;
for(int i=2;i<=N;i++)
answer=std::max(answer,arr[i]-arr[i-1]);
return answer;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:9:15: warning: variable 'maximum' set but not used [-Wunused-but-set-variable]
    9 |     long long maximum;
      |               ^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...