# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
23001 | kdh9949 | Gap (APIO16_gap) | C++14 | 109 ms | 7460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <algorithm>
using namespace std;
typedef long long ll;
vector<ll> v;
ll a = 0, b = (1LL << 62), c, x, y, ans;
ll findGap(int T, int N)
{
if(T == 1){
for(int i = 0; i < (N + 1) / 2; i++){
MinMax(a + 1, b - 1, &a, &b);
v.push_back(a); v.push_back(b);
}
}
else{
MinMax(a, b, &a, &b);
v.push_back(a); v.push_back(b);
c = b - a; N--;
for(int i = 0; i < N; i++){
ll q = a + c / N * i + 1;
ll w = a + c / N * (i + 1);
if(w == b) w--;
if(q > w) continue;
MinMax(q, w, &x, &y);
if(x == -1) continue;
v.push_back(x); v.push_back(y);
}
}
sort(v.begin(), v.end());
for(int i = 1; i < v.size(); i++) ans = max(ans, v[i] - v[i - 1]);
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |