Submission #1011695

#TimeUsernameProblemLanguageResultExecution timeMemory
1011695u_suck_oRectangles (IOI19_rect)C++17
37 / 100
5050 ms28500 KiB
#include "bits/stdc++.h" #include "rect.h" using namespace std; int n, m; long long count_rectangles(vector<vector<int>> a) { int cnt = 0; n = a.size(); m = a[0].size(); for (int t = 1; t < n-1; t++) { for (int b = t; b < n-1; b++) { for (int l = 1; l < m-1; l++) { for (int r = l; r < m-1; r++) { bool valid = true; for (int i = t; i <= b; i++) { for (int j = l; j <= r; j++) { if (a[i][j] >= a[i][l-1]) valid = false; if (a[i][j] >= a[i][r+1]) valid = false; if (a[i][j] >= a[t-1][j]) valid = false; if (a[i][j] >= a[b+1][j]) valid = false; if (!valid) break; } if (!valid) break; } if (valid) cnt++; } } } } return cnt; }
#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...