当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3731:God of Number Theory

题目描述
In ACM_DIY, there is one master called “AekdyCoin”. As we know, he is the god of “Number Theory”. He always kills the problem about “Number Theory” in seconds! But of course we do not have any idea about these problems~ One day in ACM_DIY, AekdyCoin asks us one problem:
You are given three non-negative integers A, B and K, you are expected to find how many X that satisfy.
X^A = B( mod (2K + 1) )
X is in the ranger [0, 2K];

Of course we have no idea about this problem, so could you help us?
输入解释
The first line is one integer T indicates the number of the test cases. (T <= 1000)
Then for every case, only one line contains three integers A, B and K. (1 <= A, B <= 10^9, 1 <= K <= 5 * 10^8)
输出解释
Output the answer in a single line.
输入样例
3

1 1 1
11 11 11
111 111 111
输出样例
1
0
0
来自杭电HDUOJ的附加信息
Author God of Number Theory -- AekdyCoin
Recommend notonlysuccess

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 ACMDIY第二届群赛

源链接: HDU-3731

最后修改于 2020-10-25T23:06:29+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)