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"
#include <cstdio>
#include <unistd.h>
#include <cassert>
#include <string>
using namespace std;
long long count_rectangles(std::vector<std::vector<int> > a) {
int n = a.size();
int m = a[0].size();
int count = 0;
for (int i=1; i<n-1; i++) {
for (int j=1; j<m-1; j++) {
for (int k=i; k<n-1; k++) {
for (int l=j; l<m-1; l++) {
// check i,j to k,l
bool ok = true;
for (int x=i; x<=k; x++) {
for (int y=j; y<=l; y++) {
if (a[x][y] >= a[i-1][y]) ok = false;
if (a[x][y] >= a[k+1][y]) ok = false;
if (a[x][y] >= a[x][j-1]) ok = false;
if (a[x][y] >= a[x][l+1]) ok = false;
}
}
count += ok;
}
}
}
}
return count;
}
# | 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... |