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

建议使用的浏览器:

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

5597:GTW likes function

题目描述
Now you are given two definitions as follows.

$f(x)=\sum_{k=0}^{x}(-1)^{k}2^{2x-2k}C_{2x-k+1}^{k},f_{0}(x)=f(x),f_{n}(x)=f(f_{n-1}(x))(n\geq 1)$

Note that $\varphi(n)$ means Euler’s totient function.($\varphi(n)$is an arithmetic function that counts the positive integers less than or equal to n that are relatively prime to n.)

For each test case, GTW has two positive integers — $n$ and $x$, and he wants to know the value of the function $\varphi(f_{n}(x))$.
输入解释
There is more than one case in the input file. The number of test cases is no more than 100. Process to the end of the file.

Each line of the input file indicates a test case, containing two integers, $n$ and $x$, whose meanings are given above. $(1\leq n,x \leq 10^{12})$
输出解释
In each line of the output file, there should be exactly one number, indicating the value of the function $\varphi(f_{n}(x))$ of the test case respectively.
输入样例
1 1
2 1
3 2
输出样例
2
2
2
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5597

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

共提交 0

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