# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154395 | rama_pang | Rectangles (IOI19_rect) | C++14 | 4165 ms | 838788 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 "rect.h"
#include <bits/stdc++.h>
using namespace std;
struct bit {
vector<int> tree;
bit(int &n) {
tree.assign(n + 1, 0);
}
void update(int &n, int &x) {
for (int i = n + 1; i < tree.size(); i += (i & -i)) tree[i] += x;
}
int query(int n) {
int res = 0;
for (int i = n + 1; i > 0; i -= (i & -i)) res += tree[i];
return res;
}
};
void get_interval(vector<int> &a, vector<int> &L, vector<int> &R) {
int n = a.size(); vector<int> s; s.reserve(n);
for (int i = 0; i < n; i++) L[i] = -1, R[i] = -1;
for (int i = 0; i < n; i++) { //find biggest on left side
while (s.size() && a[s.back()] < a[i]) s.pop_back();
if (s.size()) L[i] = s.back();
s.push_back(i);
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |