/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int work(int, int)':
foo.cpp:40:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < p. size(); i++)
                     ~~^~~~~~~~~~~
foo.cpp:42:42: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int> >::value_type&)'
         if (find(q.begin(), q.end(), p[i]) != q.end())
                                          ^
In file included from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/locale_facets.h:48:0,
                 from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/basic_ios.h:37,
                 from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:44,
                 from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ostream:38,
                 from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/iostream:39,
                 from foo.cpp:9:
C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/streambuf_iterator.h:369: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&)
     find(istreambuf_iterator<_CharT> __first,
     ^~~~
C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/streambuf_iterator.h:369:5: note:   template argument deduction/substitution failed:
foo.cpp:42:42: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
         if (find(q.begin(), q.end(), p[i]) != q.end())
                                          ^

信息

递交者
类型
递交
题目
P1000 A+B Problem
语言
C++
递交时间
2017-02-12 17:30:09
评测时间
2017-02-12 17:30:10
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes