#include <bits/stdc++.h>
#include "weirdtree.h"
#ifdef MINA
#include "grader.cpp"
#endif
using namespace std;
#define ll long long
const int N = 3e5 + 5;
int n;
ll a[N];
void initialise(int _n, int _q, int h[]) {
n = _n;
for (int i = 1; i <= n; i++) {
a[i] = h[i];
}
}
void cut(int l, int r, int k) {
while (k--) {
pair<ll, int> mx = {-1e18, -1e9};
for (int i = l; i <= r; i++) {
mx = max(mx, {a[i], -i});
}
int idx = -mx.second;
a[idx] = max(a[idx] - 1, 0ll);
}
}
void magic(int i, int x) {
a[i] = x;
}
ll inspect(int l, int r) {
ll s = 0;
for (int i = l; i <= r; i++) {
s += a[i];
}
return s;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
940 ms |
4708 KB |
Output is correct |
4 |
Correct |
957 ms |
5212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2044 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2044 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2044 ms |
3836 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
940 ms |
4708 KB |
Output is correct |
4 |
Correct |
957 ms |
5212 KB |
Output is correct |
5 |
Execution timed out |
2044 ms |
348 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
940 ms |
4708 KB |
Output is correct |
4 |
Correct |
957 ms |
5212 KB |
Output is correct |
5 |
Execution timed out |
2044 ms |
348 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |