正整数指数的快速幂
摘要:用递归,每次幂次升半。 1 typedef long long ll; 2 ll quick_pow(ll a, int n) 3 { 4 // 出口设置 5 if (n == 0) return 1; 6 ll ans = a; 7 int ex = 1; // 幂次 8 while ((ex <
阅读全文
posted @ 2020-04-16 22:12
机器永远是对的,未测试的代码永远是错的
posted @ 2020-04-16 22:12
posted @ 2020-04-16 21:32
posted @ 2020-04-16 20:03
posted @ 2020-04-12 15:36