# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433204 | qwerasdfzxcl | 역사적 조사 (JOI14_historical) | C++14 | 1758 ms | 5664 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>
typedef long long ll;
using namespace std;
const int BUCKET = 320;
struct Query{
int s, e, x;
Query(){}
Query(int _s, int _e, int _x): s(_s), e(_e), x(_x) {}
bool operator<(const Query &Q) const{
if (s/BUCKET==Q.s/BUCKET) return e<Q.e;
return s/BUCKET<Q.s/BUCKET;
}
}query[100100];
int a[100100], idx[100100];
ll ans[100100];
vector<int> v;
struct Seg{
ll tree[200200];
int sz;
void init(int n) {sz=n;}
void update(int p, int val){
for (tree[p+=sz]+=val;p>1;p>>=1) tree[p>>1] = max(tree[p], tree[p^1]);
}
ll query(int l){
int r = sz;
ll ret = 0;
for (l +=sz, r += sz;l<r;l>>=1, r>>=1){
if (l&1) ret = max(ret, tree[l++]);
if (r&1) ret = max(tree[--r], ret);
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... |