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 ;
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 e = i ; e < n - 1 ; e ++){
for(int j = 1 ; j < m - 1 ; j ++){
for(int ej = j ; ej < m - 1 ; ej ++){
for(int r = i ; r <= e ; r ++){
for(int c = j ; c <= ej ; c ++){
if(a[r][c] >= a[i - 1][c] || a[r][c] >= a[e + 1][c] || a[r][c] >= a[r][j - 1] || a[r][c] >= a[r][ej + 1])
goto A ;
}
}
ans ++ ;
A : continue ;
}
}
}
}
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... |