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;
#define pb push_back
#define ll long long int
ll count_rectangles(vector<vector<int>> a)
{
int n = (int)a.size();
int m = (int)a[0].size();
ll res = 0;
for(int i = 1; i<n-1; i++)
{
for(int j = 1; j<m-1; j++)
{
for(int x = i; x<n-1; x++)
{
for(int y = j; y<m-1; y++)
{
bool flag = true;
for(int h = i; h<=x; h++)
{
for(int k = j; k<=y; k++)
{
if(a[h][k]>=a[h][j-1])
flag = false;
if(a[h][k]>=a[h][y+1])
flag = false;
if(a[h][k]>=a[i-1][k])
flag = false;
if(a[h][k]>=a[x+1][k])
flag = false;
if(!flag)
break;
}
if(!flag)
break;
}
if(flag)
{
/*point.pb(mp(i, j));
point.pb(mp(x, y));*/
res++;
}
}
}
}
}
return res;
}
# | 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... |