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>
#include "rect.h"
using namespace std;
long long count_rectangles(vector<vector<int> > A){
int N = A.size(), M = A[0].size(); long long ans = 0;
for(int i = 1; i < N - 1; i++){
for(int j = i; j < N - 1; j++){
for(int k = 1; k < M - 1; k++){
for(int l = k; l < M - 1; l++){
bool flag = true;
for(int x = i; x <= j; x++) {
for(int y = k; y <= l; y++) {
if(A[x][y] >= min({A[i - 1][y], A[j + 1][y], A[x][k - 1], A[x][l + 1]})){
flag = false; break;
}
}
}
if(flag) ans++;
}
}
}
}
return ans;
}
# | 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... |