# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
747507 | Toxtaq | Discharging (NOI20_discharging) | C++17 | 1084 ms | 178208 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;
int n;
vector<int>v;
vector<long long>table;
struct SegmentTree{
vector<int>segTree;
void init(int n){
segTree.resize(4 * n);
}
void Build(int node, int l, int r, vector<int>&v){
if(l == r){
segTree[node] = v[l];
}
else{
int mid = (l + r) >> 1;
Build(node * 2, l, mid, v);
Build(node * 2 + 1, mid + 1, r, v);
segTree[node] = max(segTree[node * 2], segTree[node * 2 + 1]);
}
}
int Query(int node, int l, int r, int ql, int qr){
if(ql <= l && r <= qr)return segTree[node];
if(ql > r || l > qr)return -1;
int mid = (l + r) >> 1;
int lc = Query(node * 2, l, mid, ql, qr);
int rc = Query(node * 2 + 1, mid + 1, r, ql, qr);
return max(lc, rc);
}
};
# | 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... |