记录详情

Compile Error

foo.cc: In function 'void Match(std::string)':
foo.cc:11:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |  for (int i = 0; i < a.size(); i++)
      |                  ~~^~~~~~~~~~
foo.cc:18:24: error: no matching function for call to 'max(std::stack<int>::size_type, int&)'
   18 |    dep=max(S.size(),dep);
      |                        ^
In file included from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_algobase.h:222:5: note: candidate: 'template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)'
  222 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:222:5: note:   template argument deduction/substitution failed:
foo.cc:18:24: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   18 |    dep=max(S.size(),dep);
      |                        ^
In file included from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_algobase.h:268:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  268 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:268:5: note:   template argument deduction/substitution failed:
foo.cc:18:24: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   18 |    dep=max(S.size(),dep);
      |                        ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1350 OO11-6 括号的深度
语言
C++
递交时间
2022-05-06 16:31:47
评测时间
2022-05-06 16:31:47
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes