# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
769079 | t6twotwo | Comparing Plants (IOI20_plants) | C++17 | 395 ms | 32576 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "plants.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N, K;
vector<int> R, A, pfs;
int dis(int x, int y) {
if (x < y) {
return y - x;
} else {
return N - x + y;
}
}
void init(int k, std::vector<int> r) {
K = k, R = r; N = R.size();
if (K == 2) {
pfs.resize(N + 1);
for (int i = 0; i < N; i++) {
pfs[i + 1] = pfs[i] + R[i];
}
return;
}
A.resize(N, -1);
int M = 2 << __lg(N - 1);
vector<int> st(2 * M - 1), lazy(2 * M - 1);
auto push = [&](int p) {
st[p * 2 + 1] += lazy[p];
st[p * 2 + 2] += lazy[p];
lazy[p * 2 + 1] += lazy[p];
lazy[p * 2 + 2] += lazy[p];
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |