# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1083333 | sonamoo | Gap (APIO16_gap) | C++14 | 48 ms | 3268 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <bits/stdc++.h>
#define pii pair<ll,ll>
#define ll long long
using namespace std;
pii query(ll s , ll e) {
pii ret;
MinMax(s , e , &ret.first , &ret.second);
return ret;
}
vector<ll> v;
long long findGap(int T, int N)
{
pii x = query(0 , 2e18);
ll mi = x.first , ma = x.second;
ll gap = (ma-mi+N-2)/(N-1);
for (ll i = mi; i <= ma; i += gap+1) {
pii ret=query(i , i+gap);
if (ret.first!=-1) v.push_back(ret.first);
if (ret.second!=-1) v.push_back(ret.second);
}
ll ans=0;
for (int i = 0; i < v.size()-1; i++) ans = max(ans , v[i+1]-v[i]);
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |