int quick_pow(int a, int n){ int ans = 1; while (n) { if (n & 1) { ans = (long long )ans * a % inf; } n >>= 1; a = (long long ) a * a % inf; } return ans;}
本文共 260 字,大约阅读时间需要 1 分钟。
int quick_pow(int a, int n){ int ans = 1; while (n) { if (n & 1) { ans = (long long )ans * a % inf; } n >>= 1; a = (long long ) a * a % inf; } return ans;}
转载于:https://www.cnblogs.com/balfish/p/4014508.html