diff --git a/AcWing/89/89.cpp b/AcWing/89/89.cpp new file mode 100644 index 00000000..4ffb6f89 --- /dev/null +++ b/AcWing/89/89.cpp @@ -0,0 +1,17 @@ +#include + +using namespace std; + +long long a, b, p, ans = 1; + +int main() { + cin >> a >> b >> p; + a %= p; + while (b) { + if (b & 1) ans = ans * a % p; + a = a * a % p; + b >>= 1; + } + cout << ans % p << endl; + return 0; +}