이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include "gap.h"
long long findGap (int t , int n){
int l,r,i;
long long st,dr,a,b,sol;
if (t == 1){
long long w[100010];
st = 1;
dr = 1000000000000000000;
l = 1;
r = n;
while (l<=r){
a=b=0;
MinMax (st,dr,&a,&b);
if (l < r){
w[l] = a;
w[r] = b;
}
else {
w[l] = a;
}
st = a + 1;
dr = b - 1;
l++;
r--;
}
sol = 0;
for (i=2;i<=n;i++){
if (sol < w[i] - w[i-1])
sol = w[i] - w[i-1];
}
return sol;
}
}
컴파일 시 표준 에러 (stderr) 메시지
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |