/ Vijos /

记录详情

Compile Error

foo.cc: In function 'int find_father(int)':
foo.cc:16:41: error: no matching function for call to 'find(int&)'
   16 |     else return father[x]=find(father[x]);
      |                                         ^
In file included from /usr/include/c++/9/bits/locale_facets.h:48,
                 from /usr/include/c++/9/bits/basic_ios.h:37,
                 from /usr/include/c++/9/ios:44,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/streambuf_iterator.h:373:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)'
  373 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/9/bits/streambuf_iterator.h:373:5: note:   template argument deduction/substitution failed:
foo.cc:16:41: note:   mismatched types 'std::istreambuf_iterator<_CharT>' and 'int'
   16 |     else return father[x]=find(father[x]);
      |                                         ^
In file included from /usr/include/c++/9/algorithm:62,
                 from foo.cc:2:
/usr/include/c++/9/bits/stl_algo.h:3930:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
 3930 |     find(_InputIterator __first, _InputIterator __last,
      |     ^~~~
/usr/include/c++/9/bits/stl_algo.h:3930:5: note:   template argument deduction/substitution failed:
foo.cc:16:41: note:   candidate expects 3 arguments, 1 provided
   16 |     else return father[x]=find(father[x]);
      |                                         ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1234 口袋的天空
语言
C++
递交时间
2022-03-02 15:42:03
评测时间
2022-03-02 15:42:03
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes