This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
using namespace std;
const int mxn = 3e5 + 10;
int diff[mxn];
int n, k;
int d[mxn];
int ans[mxn] = {};
bool comp = 0;
void inicjuj(int N, int K, int *D)
{
n = N, k = K;
for(int i = 0; i < N; ++i) {
d[i + 1] = D[i];
}
}
void podlej(int a, int b)
{
++b, ++a;
++diff[a], --diff[b + 1];
}
int dojrzale(int a, int b)
{
++b, ++a;
if(!comp) {
for(int i = 1; i <= n; ++i) {
diff[i] += diff[i - 1];
d[i] += diff[i];
ans[i] = ans[i - 1] + (d[i] >= k ? 1 : 0);
}
}
return ans[b] - ans[a - 1];
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |