# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
391509 | _eve | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++17 | 1865 ms | 104860 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>
#define ll long long
using namespace std;
const int N = (int)1e6 + 10;
const int mod = 1e9 + 7;
const ll inf = 1e17 + 10;
int n, q, a[N], ans[N];
struct Q{
int l,k,id;
Q() {};
Q(int _l,int _k,int _id) : l(_l), k(_k), id(_id) {};
};
vector<Q> query[N];
ll t[N * 4];
void upd(int p,ll x,int u,int l,int r) {
if(l == r) {
t[u] = x;
return;
}
int m = l + r >> 1;
if(p <= m) upd(p,x,u << 1,l,m);
else upd(p,x,u << 1 | 1,m + 1,r);
t[u] = max(t[u << 1],t[u << 1 | 1]);
}
int get(int ql,int qr,int u,int l,int r) {
if(ql > r || l > qr) return -1;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |