Submission #775789

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7757892023-07-07 01:23:15Sandarach151Arranging Shoes (IOI19_shoes)C++17
100 / 100
165 ms141316 KiB
#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{
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...