이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define ent "\n"
const int maxn = 1e6 + 100;
const ll INF = (1ll<<61);
const int MOD = 1e9 + 7;
const int inf = (1<<30);
const int maxl = 20;
const int P = 31;
ll findGap(int t, int n){
if(t == 1){
} else{
ll mn, mx, ans = 0;
MinMax(0, 1e18, &mn, &mx);
ll d = (mx - mn) / (n - 1);
ll x = (mx - mn) % (n - 1);
ll p = -1;
for(ll i = mn; i <= mx;){
ll r = i + d + bool(x--);
ll tl, tr; MinMax(i, r - 1, &tl, &tr);
if(tr != -1){
if(p != -1) ans = max(ans, tl - p);
p = tr;
}
i = r;
}
return ans;
}
}
컴파일 시 표준 에러 (stderr) 메시지
gap.cpp: In function 'll findGap(int, int)':
gap.cpp:37:1: warning: control reaches end of non-void function [-Wreturn-type]
37 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |