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