Submission #289742

#TimeUsernameProblemLanguageResultExecution timeMemory
289742OzyRectangles (IOI19_rect)C++17
37 / 100
5085 ms46968 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i = (a); i <= (b); i++) #define lli long long int #define debug(a) cout << #a << " = " << a << endl struct x{ lli fila; lli colu; }; lli visitados[2502][2502]; lli arr[2500][2500],MAXf[2500],MAXc[2500]; lli fil,col,res,cont; bool bci, bfi, bff, bcf, ok; long long count_rectangles(std::vector<std::vector<int> > a) { fil = a.size(); col = a[0].size(); rep(i,0,fil-1) { rep(j,0,col-1) { arr[i][j] = a[i][j]; } } cont = 0; res = 0; rep(ci, 1, col-2) { rep(fi, 1, fil-2) { rep(ff, fi, fil - 2) { rep(i, fi, ff) MAXf[i] = 0; bcf = false; rep(cf, ci, col - 2) { ok = true; MAXc[cf] = 0; rep(i, fi, ff) { MAXf[i] = max(MAXf[i], arr[i][cf]); if (arr[i][ci - 1] <= MAXf[i]) { bcf = true; ok = false; break; } if (arr[i][cf + 1] <= MAXf[i]) ok = false; MAXc[cf] = max(MAXc[cf], arr[i][cf]); } if (arr[fi - 1][cf] <= MAXc[cf] || arr[ff + 1][cf] <= MAXc[cf]){ break; } else if (ok) res++; if (bcf) break; } } } } return res; }
#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...