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;
bool vis[201][201][201][201];
long long count_rectangles(vector<vector<int> > a)
{
long long rez=0;
int n=a.size();
int m=a[0].size();
for(int i1=1;i1<n-1;i1++)
{
for(int j1=1;j1<m-1;j1++)
{
for(int i2=i1;i2<n-1;i2++)
{
for(int j2=j1;j2<m-1;j2++)
{
bool check=0;
for(int i=i1;i<=i2;i++)
{
if(check)break;
for(int j=j1;j<=j2;j++)
{
if(a[i][j]>=a[i1-1][j] || a[i][j]>=a[i][j1-1] || a[i][j]>=a[i2+1][j] || a[i][j]>=a[i][j2+1])
{
check=1;
break;
}
}
}
if(!check)rez++;
}
}
}
}
return rez;
}
# | 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... |