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 <bits/stdc++.h>
#include "rect.h"
#define fi first
#define se second
#define pll pair<ll, ll>
#define pii pair<int, int>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MAXN = 1123456;
const ll N = 2e5;
long long count_rectangles(vector<vector<int> > a) {
ll n = a.size(), m = a[0].size();
if(n < 3)return 0;
if(n == 3){
int ans = 0, mx = 0;
for(int i = 1; i < m - 1; i++){
mx = 0;
for(int j = i; j < m - 1; j++){
mx = max(mx, a[1][j]);
if(a[0][j] <= a[1][j] || a[2][j] <= a[1][j])continue;;
if(a[1][i - 1] > mx && mx < a[1][j + 1])ans = max(ans, j - i + 1);
}
}
return ans;
}
return 1;
}
# | 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... |