# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
231409 | thebes | Synchronization (JOI13_synchronization) | C++14 | 910 ms | 28024 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;
const int MN = 1e5+5, LG = 19;
int st[3*MN], lz[3*MN], sp[MN][LG], N, M, Q, i, x, y, dep[MN], vis[MN][2], lst[MN], nxt, sz[MN], on[MN];
pair<int,int> e[MN];
vector<int> adj[MN];
inline void upd_lz(int i,int s,int e){
st[i] += lz[i];
if(s!=e){
lz[2*i] += lz[i];
lz[2*i+1] += lz[i];
}
lz[i] = 0;
}
void upd(int i,int s,int e,int ss,int se,int v){
upd_lz(i, s, e);
if(s>=ss&&e<=se){lz[i]=v; upd_lz(i,s,e);}
else{
if((s+e)/2<ss) upd(2*i+1,(s+e)/2+1,e,ss,se,v),upd_lz(2*i,s,(s+e)/2);
else if((s+e)/2>=se) upd(2*i,s,(s+e)/2,ss,se,v),upd_lz(2*i+1,(s+e)/2+1,e);
else upd(2*i,s,(s+e)/2,ss,se,v),upd(2*i+1,(s+e)/2+1,e,ss,se,v);
st[i]=st[2*i]+st[2*i+1];
}
}
int qu(int i,int s,int e,int idx){
upd_lz(i,s,e);
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... |