Submission #1037179

#TimeUsernameProblemLanguageResultExecution timeMemory
1037179HappyCapybaraRectangles (IOI19_rect)C++17
37 / 100
5081 ms28428 KiB
#include "rect.h" #include<bits/stdc++.h> using namespace std; #define ll long long ll count_rectangles(vector<vector<int>> a){ int n = a.size(), m = a[0].size(); ll res = 0; for (int k=1; k<m-1; k++){ for (int l=k; l<m-1; l++){ for (int i=1; i<n-1; i++){ bool stop = false; for (int j=i; j<n-1; j++){ for (int y=k; y<=l; y++){ if (stop) break; if (a[j][y] >= min(a[i-1][y], min(a[j][k-1], a[j][l+1]))) stop = true; } if (stop) break; bool valid = true; for (int x=i; x<=j; x++){ if (!valid) break; for (int y=k; y<=l; y++){ if (!valid) break; if (a[x][y] >= a[j+1][y]) valid = false; } } if (valid) res++; } } } } 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...