# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
891769 | Trisanu_Das | Rectangles (IOI19_rect) | C++17 | 0 ms | 0 KiB |
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"
using namespace std;
long long count_rectangles(vector<vector<int> > A){
int N = A.size(), M = A[0].size(); long long ans = 0;
for(int i = 1; i < N - 1; i++){
for(int j = i; j < N - 1; j++){
for(int k = 1; k < N - 1; k++){
for(int l = k; l < N - 1; l++){
bool flag = true;
for(int x = i; x <= j; x++) for(int y = k; y <= l; y++) if(A[x][y]+ >= A[i - 1][y] || A[x][y] >= A[j + 1][y] || A[x][y] >= A[x][k - 1] || A[x][y] >= A[x][l + 1]) flag = false;
if(flag) ans++;
}
}
}
}
return ans;
}