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,p,k) for(int i=(p);i<=(k);++i)
#define REP(i,n) FOR(i,0,(n)-1)
#define ssize(x) (int((x).size()))
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
ll count_rectangles(vector<vector<int>> wej){
int n = ssize(wej);
int m = ssize(wej[0]);
if(n<3 || m<3) return 0ll;
ll wyn = 0ll;
FOR(lewo, 1, m-2) FOR(prawo, lewo, m-2){
FOR(gora, 1, n-2) FOR(dol, gora, n-2){
bool git = 1;
FOR(i, gora, dol) FOR(j, lewo, prawo){
if(wej[i][j] >= wej[i][lewo-1]) git = 0;
if(wej[i][j] >= wej[i][prawo+1]) git = 0;
if(wej[i][j] >= wej[gora-1][j]) git = 0;
if(wej[i][j] >= wej[dol+1][j]) git = 0;
}
if(git) ++wyn;
}
}
return wyn;
}
# | 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... |