Problem exponentiate
User yuhong
Submission Time 2023-03-04 23:03:49
Score 0
Max Time N/A
Max Memory N/A

Compile Error

exponentiate.cpp: In function ‘long long int p(long long int, long long int)’:
exponentiate.cpp:33:26: error: invalid operands of types ‘__gnu_cxx::__promote_2<long long int, long long int, double, double>::__type’ {aka ‘double’} and ‘long long int’ to binary ‘operator%’
33 | ll res = pow(a, b/2) % m;
| ~~~~~~~~~~~ ^ ~
| | |
| | long long int
| __gnu_cxx::__promote_2<long long int, long long int, double, double>::__type {aka double}
exponentiate.cpp: In function ‘void solve()’:
exponentiate.cpp:41:26: error: invalid operands of types ‘__gnu_cxx::__promote_2<long long int, long long int, double, double>::__type’ {aka ‘double’} and ‘long long int’ to binary ‘operator%’
41 | cout << pow(a, b)%m << endl;
| ~~~~~~~~~^~
| | |
| |