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"
using namespace std;
long long count_rectangles(std::vector<std::vector<int> > a) {
int n = (int)a.size();
int m = (int)a[0].size();
if(n < 3 || m < 3) return 0;
long long res = 0;
for(int i=1; i<m-1; i++){
int mx = a[1][i];
for(int j=i; j<m-1; j++){
mx = max(a[1][j], mx);
if(a[1][j] >= a[0][j] || a[1][j] >= a[2][j]) break;
if(mx < a[1][j+1] && mx < a[1][i-1]) 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... |