Problem exponentiate
User WHEE29alt
Submission Time 2024-12-23 13:51:32
Score 0
Max Time N/A
Max Memory N/A

Compile Error

exponentiate.cpp: In function ‘long long int mypow(long long int, long long int)’:
exponentiate.cpp:28:42: error: ‘m’ was not declared in this scope
28 | if (n%2==1) {n--;result *= x;result %= m}
| ^
exponentiate.cpp:31:14: error: ‘m’ was not declared in this scope
31 | x %= m; n %= m;
| ^
exponentiate.cpp:33:18: error: ‘m’ was not declared in this scope
33 | return result % m;
| ^
exponentiate.cpp: In function ‘int main()’:
exponentiate.cpp:41:22: error: too many arguments to function ‘long long int mypow(long long int, long long int)’
41 | cout << mypow(a,b,m) << "\n";
| ^
exponentiate.cpp:19:11: note: declared here
19 | long long mypow(long long x, long long n) {
| ^~~~~