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;
long long count_rectangles(vector<vector<int>> a) {
int n = a.size();
int m = a[0].size();
if (n < 3 || m < 3) return 0;
long long tot = 0;
for (int i = 1; i < m-1; i++) {
int mm = 0;
for (int j = i; j < m-1; j++) {
mm = max(mm, a[1][j]);
if (a[0][j] <= a[1][j]) break;
if (a[2][j] <= a[1][j]) break;
if (a[1][i-1] <= mm) break;
if (a[1][j+1] <= mm) continue;
tot++;
}
}
return tot;
}
# | 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... |