| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 262015 | amoo_safar | Gap (APIO16_gap) | C++17 | 81 ms | 3308 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gap.h"
#define pb push_back
using namespace std;
typedef long long ll;
const ll Inf = 1e18;
ll findGap(int Tc, int N){
if(Tc == 1){
vector<ll> V;
ll L, R, L2, R2, S, T;
MinMax(0ll, Inf, &L, &R);
V.pb(L);
V.pb(R);
while(L + 1 <= R - 1){
L ++;
R --;
MinMax(L, R, &L2, &R2);
L = L2;
R = R2;
V.pb(L); V.pb(R);
}
sort(V.begin(), V.end());
ll ans = 0;
for(int i = 0; i + 1 < (int) V.size(); i++) ans = max(ans, V[i + 1] - V[i]);
return ans;
}
ll L, R, S, T;
MinMax(0ll, Inf, &L, &R);
ll D = (R - L) / (N - 1);
ll md = (R - L) % (N - 1);
ll pos = L;
ll st;
vector<ll> V;
for(int i = 0; i < N - 1; i++){
st = D;
if(i < md) st ++;
MinMax(pos, pos + st - 1, &S, &T);
if(S != -1){
V.push_back(S);
V.push_back(T);
}
pos += st;
}
sort(V.begin(), V.end());
ll ans = D + min(md, 1ll);
for(int i = 0; i + 1 < (int) V.size(); 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... | ||||
