제출 #1147274

#제출 시각아이디문제언어결과실행 시간메모리
1147274Math4Life2020Weirdtree (RMI21_weirdtree)C++20
0 / 100
2095 ms5816 KiB
#include "weirdtree.h" #include <bits/stdc++.h> using namespace std; vector<long long> h; void initialise(int N, int Q, int h0[]) { h.clear(); h.push_back(0); for (long long i=0;i<N;i++) { h.push_back(h0[i]); } } void cut(int l, int r, int k) { while (k>0) { long long xloc = -1; long long mval = 0; for (long long i=l;i<=r;i++) { if (h[i]>mval) { mval = h[i]; xloc = i; } } if (xloc==-1) { break; } h[xloc]--; k--; } } void magic(int i, int x) { h[i]=x; } long long inspect(int l, int r) { long long vf = 0; for (long long i=l;i<=r;i++) { vf += h[i]; } return vf; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...