Submission #1030897

#TimeUsernameProblemLanguageResultExecution timeMemory
1030897fv3Rectangles (IOI19_rect)C++14
0 / 100
4 ms484 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; using namespace std; typedef long long ll; ll count_rectangles(vector<vector<int>> a) { const int N = a.size(); const int M = a[0].size(); ll res = 0; for (int i = 1; i < M - 1; i++) { int mx = 0; for (int j = i; j < M - 1; j++) { if (a[1][j] >= a[0][j] || a[1][j] >= a[2][j]) break; mx = max(mx, a[1][j]); if (mx < a[1][i-1] && mx < a[1][j+1]) res++; } } return res; }

Compilation message (stderr)

rect.cpp: In function 'll count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:10:12: warning: unused variable 'N' [-Wunused-variable]
   10 |  const int N = a.size();
      |            ^
#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...