| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 473302 | blue | Rectangles (IOI19_rect) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rect.h"
#include <vector>
using namespace std;
long long count_rectangles(vector< vector<int> > A)
{
int N = (int)A.size();
int M = (int)A[0].size();
long long res = 0;
for(int r1 = 1; r1 <= N-2; r1++)
{
for(int r2 = r1; r2 <= N-2; r2++)
{
for(int c1 = 1; c1 <= M-2; c1++)
{
for(int c2 = c1; c2 <= M-2; c2++)
{
bool good = 1;
for(int i = r1; i <= r2; i++)
{
for(int j = c1; j <= c2; j++)
{
if(A[i][j] >= min({A[i][c1-1], A[i][c2+1], A[r1-1][j], A[r2+1][j]}))
good = 0;
}
}
res += good;
}
}
}
}
return res;
}
