Problem | exponentiate |
---|---|
User | hwy |
Submission Time | 2023-06-07 19:21:22 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
exponentiate.cpp: In function ‘ll power(ll, ll, ll)’:
exponentiate.cpp:10:26: error: invalid operands of types ‘__gnu_cxx::__promote_2<long long int, long long int, double, double>::__type’ {aka ‘double’} and ‘ll’ {aka ‘long long int’} to binary ‘operator%’
10 | ll ans = pow(A, B/2) % M;
| ~~~~~~~~~~~ ^ ~
| | |
| | ll {aka long long int}
| __gnu_cxx::__promote_2<long long int, long long int, double, double>::__type {aka double}
exponentiate.cpp: In function ‘int main()’:
exponentiate.cpp:23:28: error: no matching function for call to ‘pow(ll&, ll&, ll&)’
23 | cout << pow(A, B, M)%M << '\n';
| ^
In file included from /usr/include/features.h:461,
from /usr/include/x86_64-linux-gnu/c++/9/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gn