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>
#define LL long long
using namespace std;
const int N = 250;
int n,m;
int col[N][N][N],row[N][N][N];
long long count_rectangles(std::vector<std::vector<int> > a) {
n = a.size();m = a[0].size();
assert(n<=3);
if(n<3)
return 0;
LL ans = 0;
for(int i=1;i<m-1;i++){
int mx = 0;
bool q = 1;
for(int j=i;j<m-1;j++){
mx = max(mx,a[1][j]);
q &= a[1][j]<min(a[0][j],a[2][j]);
ans += q&(mx<min(a[1][i-1],a[1][j+1]));
}
}
return ans;
}
# | 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... |