Submission #197488

#TimeUsernameProblemLanguageResultExecution timeMemory
197488MinnakhmetovRectangles (IOI19_rect)C++14
37 / 100
5087 ms28380 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; #define ll long long bool check(vector<vector<int>> &a, int xl, int xr, int yl, int yr) { for (int i = xl; i <= xr; i++) { for (int j = yl; j <= yr; j++) { if (a[i][j] >= a[i][yl - 1] || a[i][j] >= a[i][yr + 1] || a[i][j] >= a[xl - 1][j] || a[i][j] >= a[xr + 1][j]) { return false; } } } return true; } ll count_rectangles(vector<vector<int>> a) { int n = a.size(), m = a[0].size(); ll ans = 0; for (int xl = 1; xl < n - 1; xl++) { for (int yl = 1; yl < m - 1; yl++) { for (int xr = xl; xr < n - 1; xr++) { for (int yr = yl; yr < m - 1; yr++) { if (check(a, xl, xr, yl, yr)) ans++; } } } } 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...