标签 - 快速幂

? 解题记录 ? ? HDU ? ? 快速幂 ? ? 生成函数 ?    2018-01-18 13:39:01    462    0    0
Description Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of painting. Suppose there are N blocks in a line and each block can be paint red, blue, green or yellow. For some myterious reasons, Panda want bo
? 解题记录 ? ? 洛谷 ? ? 快速幂 ?    2017-11-05 13:25:54    281    0    0
题目描述n 个小伙伴(编号从 0 到 n-1)围坐一圈玩游戏。按照顺时针方向给 n 个位置编号,从0 到 n-1。最初,第 0 号小伙伴在第 0 号位置,第 1 号小伙伴在第 1 号位置,……,依此类推。游戏规则如下:每一轮第 0 号位置上的小伙伴顺时针走到第 m 号位置,第 1 号位置小伙伴走到第 m+1 号位置,……,依此类推,第n − m号位置上的小伙伴走到第 0 号位置,第n-m+1 号位置上的小伙伴走到第 1 号位置,……,第 n-1 号位置上的小伙伴顺时针走到第m-1 号位置。 现在,一共进行了 10^k轮,请问 x 号小伙伴最后走到了第几号位置。 输入输出格式输入格式: &nbs