| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 897127 | raul2008487 | Gap (APIO16_gap) | C++17 | 37 ms | 4212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "gap.h"
#define ll long long
#define pll pair<ll,ll>
#define vl vector<ll>
#define pb push_back
#define in insert
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
long long findGap(int T, int N)
{
ll l, r, i, j, lo = 1, hi = 1000000000000000000, ans = 0, n = N;
MinMax(lo, hi, &l, &r);
if( T == 1 ){
vl v;
v.pb(l);
v.pb(r);
while(l != r && v.size() < n){
lo = l + 1, hi = r - 1;
MinMax(lo, hi, &l, &r);
v.pb(l);
v.pb(r);
}
sort(all(v));
for(i = 1; i<n; i++){
ans = max(ans, (v[i] - v[i-1]));
}
return ans;
}
ll a, b, d1, d2, pw = 1;
while(l != r){
a = b = -1;
while(a == -1){MinMax(l + 1, l + 1 + pw, &a, &b); pw <<= 1;}
ans = max(ans, (a - l));
pw = ans;
l = b;
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
