#include "rect.h"
#include<bits/stdc++.h>
using namespace std;
// typedef long long ll;
#define ll int
#define db(x) cerr << #x << " = " << x << " | "
#define dbg(x) cerr << #x << " = " << x << "\n"
long long count_rectangles(std::vector<std::vector<int>> a) {
ll n = a.size(), m = a[0].size();
if (n <= 2) return 0;
long long res = 0;
for (ll j = 1; j < m - 1; j++) {
if (a[1][j - 1] <= a[1][j] || a[1][j + 1] <= a[1][j]) continue;
ll mx = a[1][j];
for (ll k = j; k < m - 1; k++) {
if (a[0][k] <= a[1][k] || a[2][k] <= a[1][k]) {
break;
} else {
mx = max(mx, a[1][k]);
if (a[1][k + 1] <= mx) break;
else res++;
}
}
}
return res;
}
# | 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... |