leetcode:数学:spuer pow(372)
来源:互联网 发布:北京日报新闻网络热线 编辑:程序博客网 时间:2024/05/17 23:29
https://leetcode.com/problems/super-pow/
http://blog.csdn.net/happyxuma1991/article/details/51867822
class Solution { const int base = 1337; int powmod(int a, int k) //a^k mod 1337 where 0 <= k <= 10 { a %= base; int result = 1; for (int i = 0; i < k; ++i) result = (result * a) % base; return result; } public: int superPow(int a, vector<int>& b) { if (b.empty()) return 1; int last_digit = b.back(); b.pop_back(); return powmod(superPow(a, b), 10) * powmod(a, last_digit) % base; } };
0 0
- leetcode:数学:spuer pow(372)
- LeetCode 372 Super Pow
- [leetcode-372]Super Pow(java)
- [java][leetcode 372]Super Pow
- leetcode pow
- LeetCode - Pow
- pow数学函数
- LeetCode 第 372 题 (Super Pow)
- leetcode pow(x,n) (python)
- LeetCode - Pow(x, n) (快速幂)
- [leetCode] Pow(x,n)(分治)
- LeetCode(50) Pow(x,n)
- leetcode系列(58)Pow(x, n)
- LeetCode Pow(x,n)(分治法)
- LeetCode(50)Pow(x,n)
- LeetCode: Pow(x, n)
- LeetCode Pow(x,n)
- [Leetcode] Pow(x, n)
- adb shell top
- 【Android】AndroidStudio打包apk出现的一些问题 `Error:Execution failed for task ':app:lintVitalRelease'.
- 项目实战:引导动画-千变万化的ViewPager(文末小彩蛋)
- Android程序开发之异步加载机制 之 Handler 笔记
- 《编写可维护的JavaScript》读书笔记——3.语句和表达式
- leetcode:数学:spuer pow(372)
- You are using safe update mode and you tried to update a table without a WHERE that uses a KEY colum
- Centos javaMail 邮件无法发出
- 微信公众平台开发,微信JS-SDK对接invalid signature报错解决
- XMLParser 使用
- spring bean对象的声明周期
- 性能測試——并发用户数估算
- okhttp3 StrictMode Error
- 前端面试题 之 JavaScript