# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
143548 | haojiandan | Rectangles (IOI19_rect) | C++14 | 4195 ms | 563760 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "rect.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2510;
int n,m,d[maxn][maxn];
int top,st[maxn],N;
int shang[maxn][maxn];
int xia[maxn][maxn];
int zuo[maxn][maxn];
int you[maxn][maxn];
int Y[maxn][maxn]; // you: shang to the min
int Z[maxn][maxn]; // zuo: shang to the min
int X[maxn][maxn]; // xia: zuo to the min
int S[maxn][maxn]; // shang: zuo to the min
set<ll> s;
void add(int x1,int x2,int y1,int y2) {
if (x2<x1||y2<y1) return;
if ((you[x2][y1-1]-1==y2&&Y[x2][y1-1]<=x1)||(zuo[x2][y2+1]+1==y1&&Z[x2][y2+1]<=x1))
if ((xia[x1-1][y2]-1==x2&&X[x1-1][y2]<=y1)||(shang[x2+1][y2]+1==x1&&S[x2+1][y2]<=y1))
s.insert((ll)(x1-1)*N*N*N+(ll)(x2-1)*N*N+(y1-1)*N+y2-1);
}
ll count_rectangles(vector<vector<int> > a) {
n=a.size(); m=a[0].size(); N=max(n,m);
for (int i=0;i<n;i++)
for (int j=0;j<m;j++) d[i+1][j+1]=a[i][j];
for (int i=1;i<=n;i++) {
# | 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... |