/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:27:24: error: call of overloaded 'abs(long long int)' is ambiguous
         LL a2 = abs(l/d);
                        ^
In file included from /usr/include/c++/6/cstdlib:75:0,
                 from /usr/include/c++/6/ext/string_conversions.h:41,
                 from /usr/include/c++/6/bits/basic_string.h:5417,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/stdlib.h:735:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
/in/foo.cc:10:4: note: candidate: long long int abs(long long int)
 LL abs(LL x) { return x > 0 ? x : -x; }
    ^~~
In file included from /usr/include/c++/6/ext/string_conversions.h:41:0,
                 from /usr/include/c++/6/bits/basic_string.h:5417,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~

信息

递交者
类型
递交
题目
P1009 清帝之惑之康熙
语言
C++
递交时间
2018-01-26 09:15:47
评测时间
2018-01-26 09:15:47
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes