이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |