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

建议使用的浏览器:

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

5175:Misaki's Kiss again

题目描述
After the Ferries Wheel, many friends hope to receive the Misaki's kiss again,so Misaki numbers them $1,2...N-1,N$,if someone's number is M and satisfied the $GCD(N, M)$ equals to $N$ XOR $M$,he will be kissed again.

Please help Misaki to find all $M(1<=M<=N)$.

Note that:
$GCD(a, b)$ means the greatest common divisor of $a$ and $b$.
$A$ XOR $B$ means $A$ exclusive or $B$
输入解释
There are multiple test cases.

For each testcase, contains a integets $N (0 < N <= {10}^{10})$
输出解释
For each test case,
first line output Case #X:,
second line output $k$ means the number of friends will get a kiss.
third line contains $k$ number mean the friends' number, sort them in ascending and separated by a space between two numbers
输入样例
3
5
15
输出样例
Case #1:
1
2
Case #2:
1
4
Case #3:
3
10 12 14

提示
In the third sample, gcd(15,10)=5 and (15 xor 10)=5, gcd(15,12)=3 and (15 xor 12)=3,gcd(15,14)=1 and (15 xor 14)=1
来自杭电HDUOJ的附加信息
Recommend hujie

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

题目来源 Valentine's Day Round

源链接: HDU-5175

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

共提交 0

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