Borderou de evaluare (job #1469186)
Utilizator | Data | 7 august 2015 17:58:40 | |
---|---|---|---|
Problema | Problema rucsacului | Status | done |
Runda | Arhiva educationala | Compilator | cpp | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
user.cpp: In function ‘int main()’:
user.cpp:14:8: error: conflicting declaration ‘long long int g’
LL n, g, x, maxv = 0;
^
user.cpp:13:11: error: ‘g’ has a previous declaration as ‘std::ofstream g’
ofstream g("rucsac.out");
^
user.cpp:16:4: error: cannot bind ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ lvalue to ‘std::basic_istream<char>&&’
f >> n >> g;
^
In file included from /usr/include/c++/4.8/iostream:40:0,
from user.cpp:1:
/usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of ‘std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = std::basic_ofstream<char>]’
operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
^
user.cpp:26:15: error: invalid user-defined conversion from ‘std::ofstream {aka std::basic_ofstream<char>}’ to ‘int’ [-fpermissive]
for(int j = g; j >= 0; --j) {
^
In file included from /usr/include/c++/4.8/ios:44:0,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from user.cpp:1:
/usr/include/c++/4.8/bits/basic_ios.h:115:7: note: candidate is: std::basic_ios<_CharT, _Traits>::operator void*() const [with _CharT = char; _Traits = std::char_traits<char>] <near match>
operator void*() const
^
/usr/include/c++/4.8/bits/basic_ios.h:115:7: note: no known conversion for implicit ‘this’ parameter from ‘void*’ to ‘int’
user.cpp:27:16: error: no match for ‘operator<=’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<long long int> >::value_type {aka long long int}’ and ‘std::ofstream {aka std::basic_ofstream<char>}’)
if(j + w[i] <= g && pos[j]) {
^
user.cpp:27:16: note: candidates are:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
from /usr/include/c++/4.8/bits/char_traits.h:39,
from /usr/include/c++/4.8/ios:40,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from user.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:239:5: note: template<class _T1, class _T2> constexpr bool std::operator<=(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
^
/usr/include/c++/4.8/bits/stl_pair.h:239:5: note: template argument deduction/substitution failed:
user.cpp:27:19: note: mismatched types ‘const std::pair<_T1, _T2>’ and ‘__gnu_cxx::__alloc_traits<std::allocator<long long int> >::value_type {aka long long int}’
if(j + w[i] <= g && pos[j]) {
^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
from /usr/include/c++/4.8/bits/char_traits.h:39,
from /usr/include/c++/4.8/ios:40,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from user.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:315:5: note: template<class _Iterator> bool std::operator<=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !