Submission #723115

#TimeUsernameProblemLanguageResultExecution timeMemory
723115GrandTiger1729Rectangles (IOI19_rect)C++17
37 / 100
5044 ms22800 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; long long count_rectangles(std::vector<std::vector<int>> g){ int n = g.size(), m = g[0].size(); if (n <= 2 || m <= 2) return 0; int ans = 0; for (int l = 1; l < n - 1; l++){ for (int r = l; r < n - 1; r++){ for (int i = 1; i < m - 1; i++){ vector<int> maxn(r - l + 1); for (int j = i; j < m - 1; j++){ bool flag = 0; for (int ii = l; ii <= r; ii++){ if (min(g[l - 1][j], g[r + 1][j]) <= g[ii][j]) flag = 1; maxn[ii - l] = max(maxn[ii - l], g[ii][j]); } if (flag) break; for (int ii = l; ii <= r; ii++){ if (min(g[ii][i - 1], g[ii][j + 1]) <= maxn[ii - l]) flag = 1; } ans += !flag; } } } } 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...