Problem obstacletree
User justin271828
Submission Time 2024-12-15 16:34:24
Score 0
Max Time N/A
Max Memory N/A

Compile Error

obstacletree.cpp: In function ‘long long int dp(int, int)’:
obstacletree.cpp:18:50: error: call of overloaded ‘abs(long long int)’ is ambiguous
18 | ans += max(dp(k, 0) + abs(arr[i][b] - arr[k][0]), dp(k, 1) + abs(arr[i][b] - arr[k][1]));}
| ^
In file included from /usr/include/c++/9/bits/std_abs.h:38,
from /usr/include/c++/9/cmath:47,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,
from obstacletree.cpp:1:
/usr/include/stdlib.h:840:12: note: candidate: ‘int abs(int)’
840 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
obstacletree.cpp:11:4: note: candidate: ‘long long int abs(long long int)’
11 | l2 abs(l2 x) {return max(x, 0-x);}
| ^~~
In file included from /usr/include/c++/9/cmath:47,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,