Submission #169939

#TimeUsernameProblemLanguageResultExecution timeMemory
169939sochoRectangles (IOI19_rect)C++14
18 / 100
5093 ms28408 KiB
#include "rect.h" #include "bits/stdc++.h" #include <cstdio> #include <unistd.h> #include <cassert> #include <string> using namespace std; long long count_rectangles(std::vector<std::vector<int> > a) { int n = a.size(); int m = a[0].size(); int count = 0; for (int i=1; i<n-1; i++) { for (int j=1; j<m-1; j++) { for (int k=i; k<n-1; k++) { for (int l=j; l<m-1; l++) { // check i,j to k,l bool ok = true; for (int x=i; x<=k; x++) { for (int y=j; y<=l; y++) { if (a[x][y] >= a[i-1][y]) ok = false; if (a[x][y] >= a[k+1][y]) ok = false; if (a[x][y] >= a[x][j-1]) ok = false; if (a[x][y] >= a[x][l+1]) ok = false; } } count += ok; } } } } return count; }
#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...