# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
125483 | songc | Long Mansion (JOI17_long_mansion) | C++14 | 1142 ms | 72740 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;
typedef long long LL;
int N, Q;
int C[505050], S[2020202], E[2020202];
int L[505050], R[505050], chk[505050];
int LT[2020202], RT[2020202];
vector<int> key[505050];
void init(int id, int s, int e){
if (s == e){
LT[id] = L[s];
RT[id] = R[s];
return;
}
int mid = (s+e)/2;
init(id*2, s, mid);
init(id*2+1, mid+1, e);
LT[id] = min(LT[id*2], LT[id*2+1]);
RT[id] = max(RT[id*2], RT[id*2+1]);
}
int Lquery(int id, int s, int e, int ts, int te, int x){
if (e < ts || te < s || LT[id] > x) return -1;
if (s == e) return s;
int mid = (s+e)/2;
int ret = Lquery(id*2+1, mid+1, e, ts, te, x);
if (ret != -1) return ret;
return Lquery(id*2, s, mid, ts, te, 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... |