Submission #287242

#TimeUsernameProblemLanguageResultExecution timeMemory
287242Haunted_CppRectangles (IOI19_rect)C++17
10 / 100
5 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; const int linha = 1; for (int i = 1; i < c - 1; i++) { int cur = 0; int mx = 0; for (int j = i; j < c - 1; j++) { mx = max(mx, mat[linha][j]); if (mat[linha][j] >= mat[linha - 1][j] || mat[linha][j] >= mat[linha + 1][j]) { break; } if (mx >= mat[linha][i - 1] || mx >= 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...