Submission #834610

#TimeUsernameProblemLanguageResultExecution timeMemory
834610gromperenRectangles (IOI19_rect)C++14
0 / 100
47 ms28664 KiB
#include "rect.h" #include <bits/stdc++.h> #define ll long long using namespace std; long long count_rectangles(vector<vector<int> > a) { int n = a.size(); int m = a[0].size(); vector<vector<bool>> b(n, vector<bool>(m, 0)); ll ans = 0; for (int i = 1; i < n-1; ++i) { for (int j = 1; j < m-1; ++j) { if (a[i-1][j] <= a[i][j]) continue; if (a[i][j-1] <= a[i][j]) continue; for (int p = i; p < n-1; ++p) { if (a[p][j-1] <= a[p][j]) break; for (int q = j; q < m-1; ++q) { if (a[i-1][q] <= a[i][q]) break; if (a[p+1][q] <= a[p][q]) break; if (a[p][q+1] <= a[p][q]) break; ans++; //cout << i << " " << j << " " << p << " " << q << "\n"; } } } } 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...