# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
844765 | garyye | Rectangles (IOI19_rect) | C++17 | 334 ms | 273812 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;
#define fi first
#define se second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
typedef pair<int, int> i2;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
long long count_rectangles(vvi A) {
int n = SZ(A), m = SZ(A[0]);
vvvi C(n, vvi(m));
auto fun = [](vector<int> a) {
vector<i2> ans;
int s = SZ(a);
vector<int> p(s), l(s, -1), r(s, -1);
for (int i = 0; i < s; ++i) p[i] = i;
sort(p.begin(), p.end(), [&](int i, int j) { return a[i] < a[j]; });
for (int i : p) {
i2 x = {i, i};
if (i > 0 && l[i - 1] != -1) x.fi = l[i - 1];
if (i + 1 < s && r[i + 1] != -1) x.se = r[i + 1];
# | 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... |