/ Test /

Record Detail

Compile Error

/in/firstMissing.cpp: In function 'int firstMissingPositive(const std::vector<int>&)':
/in/firstMissing.cpp:9:23: error: class template argument deduction failed:
         rst = vector(0) - 1;
                       ^
/in/firstMissing.cpp:9:23: error: no matching function for call to 'vector(int)'
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:411:2: note: candidate: template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>
  vector(_InputIterator __first, _InputIterator __last,
  ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:411:2: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   candidate expects 3 arguments, 1 provided
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:383:7: note: candidate: template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const allocator_type&)-> std::vector<_Tp, _Alloc>
       vector(initializer_list<value_type> __l,
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:383:7: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:358:7: note: candidate: template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const allocator_type&)-> std::vector<_Tp, _Alloc>
       vector(vector&& __rv, const allocator_type& __m)
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:358:7: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   mismatched types 'std::vector<_Tp, _Alloc>' and 'int'
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:348:7: note: candidate: template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, const allocator_type&)-> std::vector<_Tp, _Alloc>
       vector(const vector& __x, const allocator_type& __a)
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:348:7: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:344:7: note: candidate: template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>
       vector(vector&& __x) noexcept
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:344:7: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   mismatched types 'std::vector<_Tp, _Alloc>' and 'int'
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:326:7: note: candidate: template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>
       vector(const vector& __x)
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:326:7: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:295:7: note: candidate: template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&)-> std::vector<_Tp, _Alloc>
       vector(size_type __n, const value_type& __value,
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:295:7: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   candidate expects 3 arguments, 1 provided
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:283:7: note: candidate: template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&)-> std::vector<_Tp, _Alloc>
       vector(size_type __n, const allocator_type& __a = allocator_type())
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:283:7: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   couldn't deduce template parameter '_Tp'
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:270:7: note: candidate: template<class _Tp, class _Alloc> vector(const allocator_type&)-> std::vector<_Tp, _Alloc>
       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:270:7: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   couldn't deduce template parameter '_Tp'
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:259:7: note: candidate: template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>
       vector()
       ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:259:7: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   candidate expects 0 arguments, 1 provided
         rst = vector(0) - 1;
                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/firstMissing.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:216:11: note: candidate: template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
/usr/include/c++/7/bits/stl_vector.h:216:11: note:   template argument deduction/substitution failed:
/in/firstMissing.cpp:9:23: note:   mismatched types 'std::vector<_Tp, _Alloc>' and 'int'
         rst = vector(0) - 1;
                       ^
/in/firstMissing.cpp:11:9: error: 'sort' was not declared in this scope
         sort(nums.begin(), nums.end());
         ^~~~
/in/firstMissing.cpp:11:9: note: suggested alternative: 'qsort'
         sort(nums.begin(), nums.end());
         ^~~~
         qsort
/in/firstMissing.cpp:8:13: warning: unused variable 'l' [-Wunused-variable]
     if (int l = sizeof(nums) == 1) {
             ^