#include "weirdtree.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> lst;
priority_queue<pair<int,int>> pq;
void initialise(int N, int Q, int h[]) {
lst.push_back(0);
for(int i = 1; i <= N; i++){
lst.push_back(h[i]);
}
}
void cut(int l, int r, int k) {
while(!pq.empty()){
pq.pop();
}
for(int i = l; i <= r; i++){
pq.push(make_pair(lst[i],-i));
}
while(k != 0){
if(pq.top().first == 0){
return;
}
k = 0;
}
lst[-pq.top().second]--;
}
void magic(int i, int x) {
lst[i] = x;
}
long long int inspect(int l, int r) {
long long int V = 0;
for(int i = l ; i <= r; i++){
V = V + lst[i];
}
return V;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
372 KB |
Output is correct |
2 |
Correct |
9 ms |
392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
372 KB |
Output is correct |
2 |
Correct |
9 ms |
392 KB |
Output is correct |
3 |
Execution timed out |
2048 ms |
2100 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2087 ms |
6720 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
372 KB |
Output is correct |
2 |
Correct |
9 ms |
392 KB |
Output is correct |
3 |
Execution timed out |
2048 ms |
2100 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
372 KB |
Output is correct |
2 |
Correct |
9 ms |
392 KB |
Output is correct |
3 |
Execution timed out |
2048 ms |
2100 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |