Submission #473302

#TimeUsernameProblemLanguageResultExecution timeMemory
473302blueRectangles (IOI19_rect)C++17
Compilation error
0 ms0 KiB
#include "rect.h" #include <vector> using namespace std; long long count_rectangles(vector< vector<int> > A) { int N = (int)A.size(); int M = (int)A[0].size(); long long res = 0; for(int r1 = 1; r1 <= N-2; r1++) { for(int r2 = r1; r2 <= N-2; r2++) { for(int c1 = 1; c1 <= M-2; c1++) { for(int c2 = c1; c2 <= M-2; c2++) { bool good = 1; for(int i = r1; i <= r2; i++) { for(int j = c1; j <= c2; j++) { if(A[i][j] >= min({A[i][c1-1], A[i][c2+1], A[r1-1][j], A[r2+1][j]})) good = 0; } } res += good; } } } } return res; }

Compilation message (stderr)

rect.cpp: In function 'long long int count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:23:95: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   23 |                             if(A[i][j] >= min({A[i][c1-1], A[i][c2+1], A[r1-1][j], A[r2+1][j]}))
      |                                                                                               ^
In file included from /usr/include/c++/10/vector:60,
                 from rect.h:5,
                 from rect.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
rect.cpp:23:95: note:   candidate expects 2 arguments, 1 provided
   23 |                             if(A[i][j] >= min({A[i][c1-1], A[i][c2+1], A[r1-1][j], A[r2+1][j]}))
      |                                                                                               ^
In file included from /usr/include/c++/10/vector:60,
                 from rect.h:5,
                 from rect.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
rect.cpp:23:95: note:   candidate expects 3 arguments, 1 provided
   23 |                             if(A[i][j] >= min({A[i][c1-1], A[i][c2+1], A[r1-1][j], A[r2+1][j]}))
      |                                                                                               ^