| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1088880 | VMaksimoski008 | Rectangles (IOI19_rect) | C++17 | 5050 ms | 28300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rect.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll count_rectangles(vector<vector<int> > mat) {
int n = mat.size(), m = mat[0].size();
if(n < 3 || m < 3) return 0;
if(n == 3) {
ll ans = 0;
for(int i=1; i+1<m; i++) {
int mx = 0;
for(int j=i; j+1<m; j++) {
if(mat[0][j] <= mat[1][j] || mat[2][j] <= mat[1][j]) break;
mx = max(mx, mat[1][j]);
if(min(mat[1][i-1], mat[1][j+1]) > mx) ans++;
}
}
return ans;
}
ll ans = 0;
for(int i=1; i+1<n; i++) {
for(int j=1; j+1<m; j++) {
for(int k=i; k+1<n; k++) {
for(int l=j; l+1<m; l++) {
bool ok = 1;
for(int x=i; x<=k&&ok; x++) {
for(int y=j; y<=l&&ok; y++) {
if(mat[i-1][y] <= mat[x][y]) ok = 0;
if(mat[k+1][y] <= mat[x][y]) ok = 0;
if(mat[x][j-1] <= mat[x][y]) ok = 0;
if(mat[x][l+1] <= mat[x][y]) ok = 0;
}
}
ans += ok;
}
}
}
}
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... | ||||
