#include "weirdtree.h"
#include <bits/stdc++.h>
#define ll long long
#define ii pair<ll,ll>
using namespace std;
vector<ll> v;
void initialise(int N, int Q, int H[]) {
// Your code here.
v.emplace_back(0);
for (int i=1;i<=N;i++){
v.emplace_back(H[i]);
}
}
void cut(int l, int r, int k) {
while (k--){
ii best={0,-1};
for (int i=l;i<=r;i++){
if (v[i]>best.first){
best.first=v[i];
best.second=i;
}
}
if (best.second!=-1) v[best.second]--;
}
// Your code here.
}
void magic(int i, int x) {
v[i]=x;
// Your code here.
}
long long int inspect(int l, int r) {
// Your code here.
ll ans=0;
for (int i=l;i<=r;i++){
ans+=v[i];
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
856 ms |
3716 KB |
Output is correct |
4 |
Correct |
835 ms |
3744 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2069 ms |
340 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2069 ms |
340 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2043 ms |
8612 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
856 ms |
3716 KB |
Output is correct |
4 |
Correct |
835 ms |
3744 KB |
Output is correct |
5 |
Execution timed out |
2069 ms |
340 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
856 ms |
3716 KB |
Output is correct |
4 |
Correct |
835 ms |
3744 KB |
Output is correct |
5 |
Execution timed out |
2069 ms |
340 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |