# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
646847 | chenwz | Abracadabra (CEOI22_abracadabra) | C++11 | 784 ms | 55612 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 llint;
typedef pair <int, int> pi;
const int MAXN = 200005;
const int MAXQ = 1000005;
int n, q, siz, ofs = 1, flg;
int p[MAXN], nxt[MAXN], sol[MAXQ];
int t[MAXN * 8];
set < pair <int, pi> > st;
vector < pair <int, pi> > v;
vector <pi> queries[MAXN];
void compute_next () {
vector <int> st;
st.push_back(n + 1);
p[n + 1] = 1e9;
for (int i = n; i >= 1; i--) {
while (p[i] > p[st.back()]) st.pop_back();
nxt[i] = st.back();
st.push_back(i);
}
}
int get_idx (int a, int b) {
return lower_bound(v.begin(), v.end(), make_pair(p[a], make_pair(a, b))) - v.begin();
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... |