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();
int coun=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 is=true;
for(int b=i; b<=j; b++){
for(int c=k; c<=l; c++){
if(a[b][c]>=a[i-1][c] || a[b][c]>=a[j+1][c] || a[b][c]>=a[b][k-1] || a[b][c]>=a[b][l+1])
is=false;
}
}
if(is)
coun++;
}
}
}
}
return coun;
}
# | 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... |