# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
899451 | pan | RMQ (NOI17_rmq) | C++17 | 77 ms | 18496 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>
//#include "bits_stdc++.h"
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define show(x) cerr << #x << " is " << x << endl;
#define show2(x,y) cerr << #x << " is " << x << " " << #y << " is " << y << endl;
#define show3(x,y,z) cerr << #x << " is " << x << " " << #y << " is " << y << " " << #z << " is " << z << endl;
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pi;
ll const INF = 1e9;
ll n,q;
ll minl ,maxl, minr, maxr;
vector<vector<pi> >queries;
vector<vector<ll> > newq;
vector<ll> ans;
struct node{
int s, e, m; //range is [s,e], m is the middle point
ll val, pos; //sum of [s,e]
ll lazy; //lazy tag of [s,e]
node *l, *r; //create two children l and r, where l is [s,m] and [m+1,e]
node (int S, int E){ //constructor called node
s = S, e = E, m = (s+e)/2;
val = 0;
pos = s;//initially all values are 0
lazy = 0; //lazy tag of 0 will mean there is no update (sentinel value)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |