제출 #111574

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1115742019-05-15 15:50:53aleksamGap (APIO16_gap)C++14
72.60 / 100
63 ms1936 KiB
#include "gap.h"
#include <bits/stdc++.h>
#define LLMAX 1000000000000000000LL
long long findGap1(int N){
long long mn, mx;
long long a[N];
MinMax(1, LLMAX, &mn, &mx);
a[0]=mn;
a[N-1]=mx;
for(int i=1; i<=N-1-i; ++i){
MinMax(a[i-1]+1, a[N-i]-1, &mn, &mx);
a[i]=mn;
a[N-i-1]=mx;
}
long long maxdiff=1;
for(int i=0; i<N-1; ++i){
if(a[i+1]-a[i]>maxdiff)
maxdiff=a[i+1]-a[i];
}
return maxdiff;
}
long long findGap2(int N)
{
if(N<=50)return findGap1(N);
long long apsmin, apsmax;
long long g=1, gg=1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

gap.cpp: In function 'long long int findGap2(int)':
gap.cpp:29:20: warning: unused variable 'apsmax' [-Wunused-variable]
  long long apsmin, apsmax;
                    ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...