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 <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <array>
using namespace std;
typedef long long ll;
ll count_rectangles(vector < vector < int > > a){
int n=a.size();
int m=a[0].size();
bool pp;
ll sol=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++){
pp=1;
for(int o=i; o<=k; o++){
for(int p=j; p<=l; p++){
if(a[o][p]>=a[i-1][p] || a[o][p]>=a[o][j-1] || a[o][p]>=a[k+1][p] || a[o][p]>=a[o][l+1]){
pp=0;
break;
}
}
if(!pp){
break;
}
}
if(pp){
sol++;
}
}
}
}
}
return sol;
}
# | 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... |