Submission #615925

#TimeUsernameProblemLanguageResultExecution timeMemory
615925Minindu2006Rectangles (IOI19_rect)C++17
0 / 100
67 ms22776 KiB
#include "rect.h" #include<bits/stdc++.h> using namespace std; long long count_rectangles(std::vector<std::vector<int> > a) { int n = a.size(), m = a[0].size(); long long ans = 0; for(int i1=1;i1<n-1;i1++) { for(int j1=1;j1<m-1;j1++) { for(int i2=i1;i2<n-1;i2++) { if(((a[i2][j1] >= a[i2][j1 - 1]) || (a[i2][j1] >= a[i1 - 1][j1]))) break; int cont = 0; for(int j2=j1;j1<m-1 && cont != 1;j2++) { int can = 1; for(int x=i1;x<=i2 && can;x++) { for(int y=j1;y<=j2 && can;y++) { if(a[x][y] >= a[i1 - 1][y] || a[x][y] >= a[i2 + 1][y] || a[x][y] >= a[x][j1 - 1] || a[x][y] >= a[x][j2 + 1]) { can = 0; cont = 1; } else cont = 0; } } ans += can; } } } } 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...