Submission #348022

#TimeUsernameProblemLanguageResultExecution timeMemory
348022juggernautRectangles (IOI19_rect)C++14
37 / 100
5060 ms34028 KiB
#include"rect.h" #include<bits/stdc++.h> #ifdef EVAL #else #include"grader.cpp" #endif using namespace std; int n,m; vector<vector<int>>a; bool check(int r1,int c1,int r2,int c2){ for(int i=r1;i<=r2;i++) for(int j=c1;j<=c2;j++) if(a[i][j]>=min(min(a[i][c1-1], a[i][c2+1]), min(a[r1-1][j], a[r2+1][j])))return 0; return 1; } long long count_rectangles(vector<vector<int>>A){ a=A;n=a.size();m=a[0].size(); int res=0; for(int i=1;i<n-1;i++) for(int j=1;j<m-1;j++) for(int I=i;I<n-1;I++) for(int J=j;J<m-1;J++)res+=check(i,j,I,J); return res; }
#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...