Borderou de evaluare (job #1686446)

Utilizator BrandonChris Luntraru Brandon Data 12 aprilie 2016 11:34:35
Problema Crescator2 Status done
Runda Arhiva de probleme Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp: In function ‘long long int GetPart(long long int, long long int)’: user.cpp:26:11: error: call of overloaded ‘abs(long long int&)’ is ambiguous if(abs(k) % 2 == 0) { ^ user.cpp:26:11: note: candidates are: In file included from /usr/include/c++/4.8/cstdlib:72:0, from /usr/include/c++/4.8/ext/string_conversions.h:41, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from user.cpp:1: /usr/include/stdlib.h:771:12: note: int abs(int) extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; ^ user.cpp:15:11: note: long long int abs(long long int) inline LL abs(LL x) { ^ In file included from user.cpp:2:0: /usr/include/c++/4.8/cmath:99:5: note: constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::abs(_Tp) [with _Tp = long long int; typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type = double] abs(_Tp __x) ^ /usr/include/c++/4.8/cmath:91:3: note: constexpr long double std::abs(long double) abs(long double __x) ^ /usr/include/c++/4.8/cmath:87:3: note: constexpr float std::abs(float) abs(float __x) ^ /usr/include/c++/4.8/cmath:81:3: note: constexpr double std::abs(double) abs(double __x) ^ In file included from /usr/include/c++/4.8/ext/string_conversions.h:41:0, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from user.cpp:1: /usr/include/c++/4.8/cstdlib:174:3: note: long long int std::abs(long long int) abs(long long __x) { return __builtin_llabs (__x); } ^ /usr/include/c++/4.8/cstdlib:166:3: note: long int std::abs(long int) abs(long __i) { return __builtin_labs(__i); } ^ user.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]

Ceva nu functioneaza?