제출 #827768

#제출 시각아이디문제언어결과실행 시간메모리
827768BaytoroRectangles (IOI19_rect)C++17
37 / 100
5049 ms34980 KiB
#include "rect.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; #define pb push_back #define fr first #define sc second const int N=2505; int a[N][N],b[N],c[N]; long long count_rectangles(vector<vector<int>> A) { int n=A.size(); int m=A[0].size(); if(min(n,m)<3) return 0; for(int i=0;i<n;i++){ for(int j=0;j<m;j++) a[i+1][j+1]=A[i][j]; } int ans=0; for(int l=2;l<n;l++){ for(int r=l;r<n;r++){ for(int i=1;i<=m;i++){ if(l==r) b[i]=a[l][i]; else b[i]=max(b[i],a[r][i]); } for(int i=2;i<m;i++){ for(int j=i;j<m;j++){ if(b[j]>=min(a[l-1][j],a[r+1][j])) break; bool cnt=1; for(int k=l;k<=r;k++){ if(i==j) c[k]=a[k][j]; else c[k]=max(c[k],a[k][j]); if(c[k]>=min(a[k][i-1],a[k][j+1])){ cnt=0; } } ans+=cnt; } } } } return ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...