이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rect.h"
#include <bits/stdc++.h>
using namespace std;
long long count_rectangles(vector<vector<int> > a) {
int ans = 0, n = a.size() - 1, m = a[0].size() - 1;
for(int bal = 1; bal < m; bal++){
for(int jobb = bal; jobb < m; jobb++){
for(int lenn = 1; lenn < n; lenn++){
for(int fenn = lenn; fenn < n; fenn++){
bool wrong = 0;
for(int i = lenn; i <= fenn; i++){
for(int j = bal; j <= jobb; j++){
if(a[i][j] >= a[i][jobb + 1]){
wrong = true;
break;
}
if(a[i][j] >= a[i][bal - 1]){
wrong = true;
break;
}
if(a[i][j] >= a[fenn + 1][j]){
wrong = true;
break;
}
if(a[i][j] >= a[lenn - 1][j]){
wrong = true;
break;
}
}
}
if(wrong == false){
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... |