Submission #287232

#TimeUsernameProblemLanguageResultExecution timeMemory
287232Haunted_CppRectangles (IOI19_rect)C++17
0 / 100
1 ms384 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; long long count_rectangles(vector<vector<int> > mat) { const int r = mat.size(); const int c = mat[0].size(); if (r <= 2) { return 0; } if (c <= 2) { return 0; } // Subtask #3 long long res = 0; for (int i = 1; i < c - 1; i++) { int cur = 0; int mn_so_far = 1e9; const int linha = 1; for (int j = i; j < c - 1; j++) { mn_so_far = min(mn_so_far, mat[linha][j]); if (mat[linha][j] <= mat[linha - 1][j] || mat[linha][j] <= mat[linha + 1][j]) { break; } if (mn_so_far <= mat[linha][i - 1] || mn_so_far <= mat[linha][j + 1]) { continue; } ++cur; } res += cur; } 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...