# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
34681 | mohammad_kilani | Wiring (IOI17_wiring) | C++14 | 653 ms | 21588 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 "wiring.h"
#include <bits/stdc++.h>
using namespace std;
#define red 1
#define blue 0
const int N = 200010;
long long seg[4 * N] , lazy[4 * N] , dp[N];
vector< pair<int,bool> > v;
int n , nxt[N];
long long getmin(int s,int e,int idx,int l,int r){
if(s > r || e < l) return 1e18;
if(s >= l && e <= r) return seg[idx] + lazy[idx];
lazy[idx*2] += lazy[idx];
lazy[idx*2+1] += lazy[idx];
seg[idx] += lazy[idx];
lazy[idx] = 0;
return min(getmin(s,(s+e)/2,idx*2,l,r),getmin((s+e)/2+1,e,idx*2+1,l,r));
}
long long update(int s,int e,int idx,int l,int r,long long val){
if(s > r || e < l) return seg[idx] + lazy[idx];
if(s >= l && e <= r){
lazy[idx] += val;
return seg[idx] + lazy[idx];
}
lazy[idx*2] += lazy[idx];
lazy[idx*2+1] += lazy[idx];
lazy[idx] =0 ;
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... |