| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 521139 | Jomnoi | Gap (APIO16_gap) | C++17 | 54 ms | 3228 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gap.h"
#define DEBUG 0
using namespace std;
const long long INF = 1e18;
long long findGap(int T, int N) {
vector <long long> a;
if(T == 1) {
a.resize(N);
MinMax(0, INF, &a[0], &a[N - 1]);
int l = 1, r = N - 2;
while(l <= r) {
MinMax(a[l - 1] + 1, a[r + 1] - 1, &a[l], &a[r]);
l++;
r--;
}
}
else {
long long L, R;
MinMax(0, INF, &L, &R);
long long minimum = (R - L + N - 2) / (N - 1);
L++;
while(L < R) {
long long nL, nR;
MinMax(L, L + minimum, &nL, &nR);
if(nL != -1 and nR != -1) {
a.push_back(nL);
a.push_back(nR);
}
L += minimum + 1;
}
}
long long ans = 0;
for(int i = 1; i < a.size(); i++) {
ans = max(ans, a[i] - a[i - 1]);
}
return ans;
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
