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