이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rect.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2512, MAXK = 13;
int n, m;
int tb[MAXN][MAXN];
long long count_rectangles(vector<vector<int> > ts) {
n = ts.size();
m = ts[0].size();
if(n < 3 || m < 3) return 0;
long long resp = 0;
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
tb[i + 1][j + 1] = ts[i][j];
}
}
for(int i = 2; i < n; i++) {
for(int j = 2; j < m; j++) {
for(int k = i; k < n; k++) {
for(int l = j; l < m; l++) {
bool ok = true;
for(int i2 = i; i2 <= k; i2++) {
for(int j2 = j; j2 <= l; j2++) {
int vl = tb[i2][j2];
if(vl >= tb[i2][j - 1] || vl >= tb[i2][l + 1] || vl >= tb[i - 1][j2] || vl >= tb[k + 1][j2]) {
ok = false;
break;
}
}
if(!ok) break;
}
if(ok) resp++;
}
}
}
}
return resp;
}
| # | 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... |