Submission #380010

#TimeUsernameProblemLanguageResultExecution timeMemory
380010SuhaibSawalha1Rectangles (IOI19_rect)C++17
31 / 100
5021 ms49388 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; long long count_rectangles(vector<vector<int>> a) { int n = a.size(), m = a[0].size(); long long ans = 0; for (int x = 1; x < n - 1; ++x) { for (int y = 1; y < m - 1; ++y) { for (int i = x; i < n - 1; ++i) { if (a[i][y] >= a[i][y - 1]) { break; } for (int j = y; j < m - 1; ++j) { bool good = 1, bad = 0; for (int l = x; l <= i && !bad; ++l) { for (int r = y; r <= j && !bad; ++r) { good &= a[l][r] < a[l][j + 1] && a[l][r] < a[i + 1][r]; bad |= a[l][r] >= a[l][y - 1] || a[l][r] >= a[x - 1][r]; } } if (bad) { break; } ans += good; } } } } return ans; }
#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...