제출 #434356

#제출 시각아이디문제언어결과실행 시간메모리
434356JUANDI321Rectangles (IOI19_rect)C++17
37 / 100
5081 ms22672 KiB
#include "rect.h" #include <vector> #include <iostream> using namespace std; long long count_rectangles(vector<vector<int>> a) { int n = a.size(), m = a[0].size(); int c = 0; for(int i = 1; i<n-1; i++) { for(int j = 1; j<m-1; j++) { for(int h = i; h<n-1; h++) { //if(a[h+1][j]<=a[h][j])break; for(int k = j; k<m-1; k++) { //if(a[h][k+1]<=a[h][k])break; //if(k-j==h-i)break; bool p = true; for(int l = i; l<=h; l++) { if(!p)break; for(int ll = j; ll<=k; ll++) { //cout<<a[l][ll]<<" "; if(a[i-1][ll] <= a[l][ll] || a[h+1][ll]<= a[l][ll] || a[l][j-1] <= a[l][ll] || a[l][k+1]<=a[l][ll])p=false; if(!p)break; } //cout<<endl; } //cout<<"---------"<<endl; if(p)c++; } } } } return c; }
#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...