| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 71490 | RezwanArefin01 | Rice Hub (IOI11_ricehub) | C++17 | 25 ms | 16132 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
const int N = 1e5 + 10;
ll y[N];
int besthub(int n, int L, int x[], ll B) {
y[0] = x[0];
for(int i = 1; i < n; i++) {
y[i] = y[i - 1] + x[i];
}
auto cost = [&x](int l, int r) {
int m = l + r >> 1;
ll a = (ll) x[m] * (m - l + 1);
a -= y[m];
if(l) a += y[l - 1];
ll b = y[r] - y[m] - (r - m) * 1ll * x[m];
return a + b;
};
int l = 0, r = 0;
int ans = 0;
while(l < n) {
while(r < n && cost(l, r) <= B) r++;
ans = max(ans, r - l);
l++;
} return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
