Submission #282389

#TimeUsernameProblemLanguageResultExecution timeMemory
282389Ruba_KRectangles (IOI19_rect)C++14
37 / 100
5094 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 ++){ for (int j2 = j ; j2 < m - 1 ; 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(!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...