/ Vijos /

记录详情

Compile Error

foo.cpp:5:1: error: expected initializer before 'int'
 int find(int x){
 ^
foo.cpp: In function 'int main()':
foo.cpp:24:24: error: no matching function for call to 'find(int&)'
      int fx=find(e[i].a),fy=find(e[i].b);
                        ^
foo.cpp:24:24: note: candidate is:
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62:0,
                 from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4455:5: note: template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)
     find(_InputIterator __first, _InputIterator __last,
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4455:5: note:   template argument deduction/substitution failed:
foo.cpp:24:24: note:   candidate expects 3 arguments, 1 provided
      int fx=find(e[i].a),fy=find(e[i].b);
                        ^
foo.cpp:25:16: error: 'fy' was not declared in this scope
         if(fx!=fy){
                ^
foo.cpp:26:10: error: 'fa' was not declared in this scope
          fa[fx]=fy;
          ^
foo.cpp:30:5: error: 'cout' was not declared in this scope
     cout<<ans<<endl;
     ^
foo.cpp:30:16: error: 'endl' was not declared in this scope
     cout<<ans<<endl;
                ^

信息

递交者
类型
递交
题目
P1723 道路修建
语言
C++
递交时间
2016-08-25 11:36:31
评测时间
2016-08-25 12:00:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes