제출 #340727

#제출 시각아이디문제언어결과실행 시간메모리
340727nandonathaniel게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include "game.h" #include "bits/stdc++.h" using namespace std; int par[1505]; void initialize(int n) { for(int i=0;i<n;i++)par[i]=i; } int hasEdge(int u, int v) { return find(u)!=find(v); }

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

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:12:15: error: no matching function for call to 'find(int&)'
   12 |  return find(u)!=find(v);
      |               ^
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/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from game.cpp:2:
/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:
game.cpp:12:15: note:   mismatched types 'std::istreambuf_iterator<_CharT>' and 'int'
   12 |  return find(u)!=find(v);
      |               ^
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from game.cpp: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:
game.cpp:12:15: note:   candidate expects 3 arguments, 1 provided
   12 |  return find(u)!=find(v);
      |               ^
game.cpp:12:24: error: no matching function for call to 'find(int&)'
   12 |  return find(u)!=find(v);
      |                        ^
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/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from game.cpp:2:
/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:
game.cpp:12:24: note:   mismatched types 'std::istreambuf_iterator<_CharT>' and 'int'
   12 |  return find(u)!=find(v);
      |                        ^
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from game.cpp: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:
game.cpp:12:24: note:   candidate expects 3 arguments, 1 provided
   12 |  return find(u)!=find(v);
      |                        ^