pole.cpp: In function ‘ll calc(ll)’:
pole.cpp:13:45: error: call of overloaded ‘abs(ll)’ is ambiguous
for(int i=1;i<n;i++) ret += abs(v[i]-i*p);
^
pole.cpp:13:45: note: candidates are:
In file included from /usr/include/c++/4.9/cstdlib:72:0,
from /usr/include/c++/4.9/bits/stl_algo.h:59,
from /usr/include/c++/4.9/algorithm:62,
from pole.cpp:3:
/usr/include/stdlib.h:775:12: note: int abs(int)
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^
pole.cpp:8:11: note: ll abs(ll)
inline ll abs(ll x) {
^
In file included from /usr/include/c++/4.9/bits/stl_algo.h:59:0,
from /usr/include/c++/4.9/algorithm:62,
from pole.cpp:3:
/usr/include/c++/4.9/cstdlib:179:3: note: __int128 std::abs(__int128)
abs(__int128 __x) { return __x >= 0 ? __x : -__x; }
^
/usr/include/c++/4.9/cstdlib:174:3: note: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^
/usr/include/c++/4.9/cstdlib:166:3: note: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^
pole.cpp: In function ‘int main()’:
pole.cpp:25:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
^
pole.cpp:27:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&t);
^