# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
659067 | qwerasdfzxcl | Matryoshka (JOI16_matryoshka) | C++17 | 347 ms | 22780 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;
struct Seg{
int tree[800800], sz;
void init(int n){sz = n;}
void update(int p, int x){
p += sz;
tree[p] = max(tree[p], x);
for (p>>=1;p;p>>=1) tree[p] = max(tree[p<<1], tree[p<<1|1]);
}
int query(int r){
int l = 0, ret = 0;
for (l+=sz, r+=sz+1;l<r;l>>=1, r>>=1){
if (l&1) ret = max(ret, tree[l++]);
if (r&1) ret = max(ret, tree[--r]);
}
return ret;
}
}tree;
struct Data{
int x, y, isq, i;
Data(){}
Data(int _x, int _y, int _q, int _i): x(_x), y(_y), isq(_q), i(_i) {}
bool operator < (const Data &D){
if (x==D.x && y==D.y) return isq < D.isq;
if (x==D.x) return y < D.y;
return x > D.x;
}
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... |