제출 #380002

#제출 시각아이디문제언어결과실행 시간메모리
380002SuhaibSawalha1Rectangles (IOI19_rect)C++14
23 / 100
2779 ms49516 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) { if (a[i][j] >= a[x - 1][j] || a[i][j] >= a[i + 1][j]) { break; } bool good = 1, bad = 0; for (int l = x; l <= i; ++l) { for (int r = y; r <= j; ++r) { good &= a[l][r] < a[l][j + 1]; bad |= a[l][r] >= a[l][y - 1]; } } 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...