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 <= 2) return 0;
int cnt = 0;
for (int i = 0; i < m-1; i++) {
int mx = a[1][i+1];
for (int j = i+2; j < m; j++) {
//cout << "! " << a[0][2] << "\n";
if (a[0][j-1] <= a[1][j-1] || a[2][j-1] <= a[1][j-1]) break;
if (a[1][j] > mx) {
mx = a[1][j];
cnt++;
//cout << i << " " << j << "\n";
if (mx >= a[1][i]) break;
}
}
}
return cnt;
}
# | 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... |