Submission #261332

#TimeUsernameProblemLanguageResultExecution timeMemory
261332SuperJavaRectangles (IOI19_rect)C++17
50 / 100
5080 ms61584 KiB
#include "rect.h" #include <vector> #define sz(a) (a.size()) using namespace std; long long count_rectangles(vector<vector<int>> a) { int n = sz(a); int m = sz(a[0]); int answer = 0; for (int r1 = 1; r1 < n-1; ++r1){ for (int c1 = 1; c1 < m-1; ++c1){ for (int r2 = r1; r2 < n-1; ++r2){ if(a[r2][c1] >= a[r2][c1-1] || a[r2][c1] >= a[r1-1][c1]){ break; } bool milhem = false; for (int c2 = c1; c2 < m-1 && !milhem; ++c2){ bool good = true; for (int i = r1; i <= r2 && good; ++i){ for (int j = c1; j <= c2 && good; ++j){ if(a[i][j] >= a[i][c1-1] || a[i][j] >= a[i][c2+1] || a[i][j] >= a[r1-1][j] || a[i][j] >= a[r2+1][j]){ good = false; } if(!good && (a[i][j] >= a[i][c1-1] || a[i][j] >= a[r1-1][j] || a[i][j] >= a[r2+1][j])){ milhem = true; } } } if(good){ answer++; } } } } } return answer; }
#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...