# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
775789 | Sandarach151 | Arranging Shoes (IOI19_shoes) | C++17 | 165 ms | 141316 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<bits/stdc++.h>
using namespace std;
class segmentTree{
private:
int sze;
vector<int> vect;
void privUpdate(int pos, int val, int nodepos, int nodeleft, int noderight){
if(nodeleft==noderight){
vect[nodepos]=val;
}
else{
int nodemid = (nodeleft+noderight)/2;
if(pos<=nodemid){
privUpdate(pos, val, 2*nodepos+1, nodeleft, nodemid);
}
else{
privUpdate(pos, val, 2*nodepos+2, nodemid+1, noderight);
}
vect[nodepos]=vect[2*nodepos+1]+vect[2*nodepos+2];
}
}
int privGetSum(int queryleft, int queryright, int nodepos, int nodeleft, int noderight){
if(queryleft>noderight || queryright<nodeleft){
return 0;
}
else if(queryleft<=nodeleft && queryright>=noderight){
return vect[nodepos];
}
else{
# | 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... |