Submission #222889

#TimeUsernameProblemLanguageResultExecution timeMemory
222889MrDominoRectangles (IOI19_rect)C++14
18 / 100
5080 ms28408 KiB
#include <bits/stdc++.h> #include "rect.h" using namespace std; typedef long long ll; long long count_rectangles(vector<vector<int>> a) { ll sol = 0; int n = (int) a.size(); int m = (int) a[0].size(); for (int r1 = 1; r1 < n - 1; r1++) { for (int c1 = 1; c1 < m - 1; c1++) { for (int r2 = r1; r2 < n - 1; r2++) { for (int c2 = c1; c2 < m - 1; c2++) { bool ok = 1; for (int i = r1; i <= r2; i++) { for (int j = c1; j <= c2; j++) { ok &= (a[i][j] < a[i][c1 - 1]); ok &= (a[i][j] < a[i][c2 + 1]); ok &= (a[i][j] < a[r1 - 1][j]); ok &= (a[i][j] < a[r2 + 1][j]); } } if (ok) { sol++; } } } } } return sol; }
#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...