foo.cc:5:13: error: array bound is not an integer constant before ']' token
int pre[MAXN];
^
foo.cc:7:10: error: 'x' was not declared in this scope
int find(x){
^
foo.cc:12:11: error: expected identifier before '(' token
void union(x, y){
^
foo.cc:12:13: error: expected ')' before ',' token
void union(x, y){
^
foo.cc:12:16: error: expected initializer before ')' token
void union(x, y){
^
foo.cc: In function 'int main()':
foo.cc:23:27: error: 'pre' was not declared in this scope
for (int i=0; i<n; ++i) pre[i] = i;
^~~
foo.cc:23:27: note: suggested alternative: 'drem'
for (int i=0; i<n; ++i) pre[i] = i;
^~~
drem
foo.cc:26:4: error: expected primary-expression before 'union'
union(a,b);
^~~~~
foo.cc:30:10: error: reference to 'find' is ambiguous
puts( find(a) == find(b) ? "yes" : "no");
^~~~
foo.cc:7:5: note: candidates are: int find
int find(x){
^~~~
In file included from /usr/include/c++/7/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
from foo.cc:1:
/usr/include/c++/7/bits/stl_algo.h:3899:5: note: template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)
find(_InputIterator __first, _InputIterator __last,
^~~~
In file included from /usr/include/c++/7/bits/locale_facets.h:48:0,
from /usr/include/c++/7/bits/basic_ios.h:37,
from /usr/include/c++/7/ios:44,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from foo.cc:1:
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note: 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&)
find(istreambuf_iterator<_CharT> __first,
^~~~
foo.cc:30:21: error: reference to 'find' is ambiguous
puts( find(a) == find(b) ? "yes" : "no");
^~~~
foo.cc:7:5: note: candidates are: int find
int find(x){
^~~~
In file included from /usr/include/c++/7/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
from foo.cc:1:
/usr/include/c++/7/bits/stl_algo.h:3899:5: note: template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)
find(_InputIterator __first, _InputIterator __last,
^~~~
In file included from /usr/include/c++/7/bits/locale_facets.h:48:0,
from /usr/include/c++/7/bits/basic_ios.h:37,
from /usr/include/c++/7/ios:44,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from foo.cc:1:
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note: 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&)
find(istreambuf_iterator<_CharT> __first,
^~~~
foo.cc:25:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&a,&b);
~~~~~^~~~~~~~~~~~~~
foo.cc:29:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&a,&b);
~~~~~^~~~~~~~~~~~~~
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。