# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
715395 | study | Gap (APIO16_gap) | C++17 | 56 ms | 2248 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gap.h"
using ll = long long;
using namespace std;
long long findGap(int T, int N){
ll pmini = -1, pmaxi = 1e18+1;
vector<ll> ans;
bool ok1 = 0, ok2 = 0;
for (int i=0; i<(N+1)/2; ++i){
long long a,b;
MinMax(pmini+1,pmaxi-1,&a,&b);
if (a == -1) break;
ans.emplace_back(a);
ans.emplace_back(b);
pmini = a;
pmaxi = b;
}
sort(ans.begin(),ans.end());
ans.erase(unique(ans.begin(),ans.end()),ans.end());
ll res = 0;
for (int i=1; i<ans.size(); ++i){
res = max(res,ans[i]-ans[i-1]);
}
return res;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |