Submission #831905

#TimeUsernameProblemLanguageResultExecution timeMemory
831905Minindu206Rectangles (IOI19_rect)C++14
50 / 100
5021 ms61688 KiB
#include "rect.h" #include<bits/stdc++.h> #define ll long long #define FOR(i, a, b) for(int i=a;i<=(b - 1);i++) using namespace std; ll count_rectangles(vector<vector<int>> a) { int n = a.size(), m = a[0].size(); ll ans = 0; FOR(a1, 1, n - 1) { FOR(b1, 1, m - 1) { FOR(a2, a1, n - 1) { if(a[a2][b1] >= a[a1 - 1][b1] || a[a2][b1] >= a[a2][b1 - 1]) break; int further = 0; FOR(b2, b1, m - 1) { if(further) break; int can = 1; FOR(i, a1, a2 + 1) { if(!can) break; FOR(j, b1, b2 + 1) { if(!can) break; if(a[i][j] >= a[a1 - 1][j] || a[i][j] >= a[i][b1 - 1] || a[i][j] >= a[a2 + 1][j] || a[i][j] >= a[i][b2 + 1]) can = 0; if(!can) further = (a[i][j] >= a[a1 - 1][j] || a[i][j] >= a[i][b1 - 1] || a[i][j] >= a[a2 + 1][j]); } } 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...