# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1160723 | hyakup | Rectangles (IOI19_rect) | C++20 | 1154 ms | 92656 KiB |
#include "rect.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int inf = 1e9 + 10;
const int maxn = 200 + 10;
const int logn = 10;
struct Node{
int l, r, u, d; Node( int l = -inf, int r = inf, int u = -inf, int d = inf ) : l(l), r(r), u(u), d(d) {}
Node operator + ( Node n ){
return Node( min( l, n.l ), max( r, n.r ), min( u, n.u ), max( d, n.d ) );
}
};
Node dp[logn][logn][maxn][maxn];
int l[maxn][maxn], r[maxn][maxn], u[maxn][maxn], d[maxn][maxn];
long long count_rectangles( vector<vector<int>> mat ) {
int n = mat.size(), m = mat[0].size();
for( int i = 0; i < n; i++ ){
stack<pair<int, pair<int, int>>> pilha;
pilha.push({ inf, make_pair(-1, -1) });
for( int j = 0; j < m; j++ ){
l[i][j] = -1; r[i][j] = m;
while( pilha.top().first < mat[i][j] ){
# | 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... |