Submission #282711

#TimeUsernameProblemLanguageResultExecution timeMemory
282711Ruba_KRectangles (IOI19_rect)C++14
37 / 100
5071 ms28408 KiB
#include "rect.h" #include<bits/stdc++.h> using namespace std ; long long count_rectangles(std::vector<std::vector<int> > a) { int ans = 0 ; int n = a.size() , m = a[0].size() ; for(int i = 1 ; i < n - 1 ; i ++){ for(int j = 1 ; j < m - 1 ; j ++){ for(int i2 = i ; i2 < n - 1 ; i2 ++){ if(a[i][j] >= a[i - 1][j] || a[i][j] >= a[i][j - 1]){ break; }int milhem = 0 ; for (int j2 = j ; j2 < m - 1 && !milhem ; j2 ++){ int flag = 0 ; for (int hi = i ; hi <= i2 && !flag; hi++){ for(int hj = j ; hj <= j2 && ! flag; hj++){ if(a[hi][hj] >= a[hi][j - 1] || a[hi][hj] >= a[hi][j2 + 1] || a[hi][hj] >= a[i - 1][hj] || a[hi][hj] >= a[i2 + 1][hj] ) flag++; if(a[hi][hj] >= a[hi][j - 1] || a[hi][hj] >= a[i - 1][hj] || a[hi][hj] >= a[i2 + 1][hj]) milhem++; } } if(!flag)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...