제출 #891773

#제출 시각아이디문제언어결과실행 시간메모리
891773Trisanu_DasRectangles (IOI19_rect)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "rect.h" using namespace std; long long count_rectangles(vector<vector<int> > A){ int N = A.size(), M = A[0].size(); long long ans = 0; for(int i = 1; i < N - 1; i++){ for(int j = i; j < N - 1; j++){ for(int k = 1; k < M - 1; k++){ for(int l = k; l < M - 1; l++){ bool flag = true; for(int x = i; x <= j; x++) { for(int y = k; y <= l; y++) { if(A[x][y] >= max(A[i - 1][y], A[j + 1][y], A[x][k - 1], A[x][l + 1])){ flag = false; break; } } } if(flag) ans++; } } } } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

rect.cpp: In function 'long long int count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:14:83: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   14 |               if(A[x][y] >= max(A[i - 1][y], A[j + 1][y], A[x][k - 1], A[x][l + 1])){
      |                                                                                   ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from rect.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
rect.cpp:14:83: note:   candidate expects 2 arguments, 4 provided
   14 |               if(A[x][y] >= max(A[i - 1][y], A[j + 1][y], A[x][k - 1], A[x][l + 1])){
      |                                                                                   ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from rect.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
rect.cpp:14:83: note:   candidate expects 3 arguments, 4 provided
   14 |               if(A[x][y] >= max(A[i - 1][y], A[j + 1][y], A[x][k - 1], A[x][l + 1])){
      |                                                                                   ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from rect.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
rect.cpp:14:83: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   14 |               if(A[x][y] >= max(A[i - 1][y], A[j + 1][y], A[x][k - 1], A[x][l + 1])){
      |                                                                                   ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from rect.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
rect.cpp:14:83: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   14 |               if(A[x][y] >= max(A[i - 1][y], A[j + 1][y], A[x][k - 1], A[x][l + 1])){
      |                                                                                   ^