Problem lcm
User SilverClaw
Submission Time 2023-03-03 23:33:22
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lcm.cpp: In function ‘uint lcm(uint, uint)’:
lcm.cpp:22:19: error: call of overloaded ‘abs(uint)’ is ambiguous
22 | return abs(a*b)/gcd(a,b);
| ^
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 lcm.cpp:1:
/usr/include/stdlib.h:840:12: note: candidate: ‘int abs(int)’
840 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
In file included from /usr/include/c++/9/cmath:47,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,
from lcm.cpp:1:
/usr/include/c++/9/bits/std_abs.h:103:3: note: candidate: ‘constexpr __float128 std::abs(__float128)’
103 | abs(__float128 __x)
| ^~~
/usr/include/c++/9/bits/std_abs.h:85:3: note: candidate: ‘constexpr __int128 std::abs