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>> g){
int n = g.size(), m = g[0].size();
if (n <= 2 || m <= 2) return 0;
int ans = 0;
for (int i = 1; i < m - 1; i++){
int maxn = 0;
for (int j = i; j < m - 1; j++){
if (min(g[0][j], g[2][j]) <= g[1][j])
break;
maxn = max(maxn, g[1][j]);
if (min(g[1][i - 1], g[1][j + 1]) > maxn)
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... |