이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
long long findGap(int test, int n) {
ll arr[n];
ll s, t, ans;
if (test == 1) {
ans = 0;
s = 0; t = 1e18;
for (int i=0;i<n/2;i++) {
MinMax(s, t, &arr[i], &arr[n - i - 1]);
s = arr[i] + 1; t = arr[n - i - 1] - 1;
}
if (n % 2 == 1) {
MinMax(s, t, &arr[n/2], &arr[n/2]);
}
for (int i=1;i<n;i++) {
ans = max(ans, arr[i] - arr[i-1]);
}
return ans;
}
}
컴파일 시 표준 에러 (stderr) 메시지
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
24 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |