# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
875864 | Mr_Ph | Weirdtree (RMI21_weirdtree) | C++17 | 2081 ms | 3780 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 "weirdtree.h"
#ifdef test
#include "grader.cpp"
#endif
#include<bits/stdc++.h>
using namespace std;
vector<int> arr;
void initialise(int N, int Q, int h[]) {
for(int i=1;i<=N;i++)
arr.push_back(h[i]);
}
void cut(int l, int r, int k) {
while(k--)
{
int mx=-1e18,idx=0;
for(int i=l-1;i<r;i++)
if(arr[i]>mx)mx=arr[i],idx=i;
// cout<<l<<" "<<r<<" "<<idx<<" "<<mx<<endl;
if(mx<=0)continue;
arr[idx]--;
}
}
void magic(int i, int x) {
arr[i-1]=x;
}
long long int inspect(int l, int r) {
long long sum=0;
for(int i=l-1;i<r;i++)sum+=arr[i];
return sum;
}
Compilation message (stderr)
# | 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... |