| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1311530 | madamadam3 | Gap (APIO16_gap) | C++20 | 35 ms | 3232 KiB |
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll findGap(int T, int N) {
if (T == 1) {
vector<ll> a;
ll s = 0, t = 1e18+1, mn = 0, mx = 0;
for (int i = 0; i < (N+1)/2; i++) {
MinMax(s, t, &mn, &mx);
if (mn != -1) a.push_back(mn), a.push_back(mx);
s = mn+1, t = mx-1;
}
sort(a.begin(), a.end());
ll ans = -1;
for (int i = 0; i < N-1; i++) ans = max(ans, a[i+1] - a[i]);
return ans;
}
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
