Golang | Leetcode Golang题解之第372题超级次方

题目:

题解:

Go 复制代码
const mod = 1337

func pow(x, n int) int {
    res := 1
    for ; n > 0; n /= 2 {
        if n&1 > 0 {
            res = res * x % mod
        }
        x = x * x % mod
    }
    return res
}

func superPow(a int, b []int) int {
    ans := 1
    for _, e := range b {
        ans = pow(ans, 10) * pow(a, e) % mod
    }
    return ans
}
相关推荐
多米Domi0117 小时前
0x3f第33天复习 (16;45-18:00)
数据结构·python·算法·leetcode·链表
Lips6117 小时前
2026.1.16力扣刷题
数据结构·算法·leetcode
今天_也很困9 小时前
LeetCode 热题100-15.三数之和
数据结构·算法·leetcode
千金裘换酒9 小时前
LeetCode 数组经典题刷题
算法·leetcode·职场和发展
alphaTao11 小时前
LeetCode 每日一题 2026/1/12-2026/1/18
python·算法·leetcode
sin_hielo11 小时前
leetcode 2943
数据结构·算法·leetcode
程序员-King.13 小时前
day134—快慢指针—环形链表(LeetCode-141)
算法·leetcode·链表·快慢指针
Swift社区13 小时前
LeetCode 376 摆动序列
算法·leetcode·职场和发展
且去填词13 小时前
深入理解 GMP 模型:Go 高并发的基石
开发语言·后端·学习·算法·面试·golang·go
a程序小傲14 小时前
京东Java面试被问:多活数据中心的流量调度和数据同步
java·开发语言·面试·职场和发展·golang·边缘计算