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 <vector>
using namespace std;
vector<vector<int> > a;
int n,m,i,j,mx;
int solve_n_mic()
{
int ans=0;
if(n<=2) return 0;
for(i=1;i<=m-2;i++)
{
bool bun=(a[1][i]<a[1][i-1]&&a[1][i]<a[0][i]&&a[1][i]<a[2][i]);
mx=a[1][i];
for(j=i;j<=m-2;j++)
{
bun&=(a[1][j]<a[0][j]&&a[1][j]<a[2][j]);
mx=max(mx,a[1][i]);
if(bun&&mx<a[1][i-1]&&mx<a[1][j+1])
ans++;
}
}
return ans;
}
long long count_rectangles(vector<vector<int> > att) {
a=att;
n=a.size();m=a[0].size();
if(n<=3)
return solve_n_mic();
return 1;
}
# | 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... |