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

建议使用的浏览器:

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

2053:Switch Game

题目描述
There are many lamps in a line. All of them are off at first. A series of operations are carried out on these lamps. On the i-th operation, the lamps whose numbers are the multiple of i change the condition ( on to off and off to on ).
输入解释
Each test case contains only a number n ( 0< n<= 10^5) in a line.
输出解释
Output the condition of the n-th lamp after infinity operations ( 0 - off, 1 - on ).
输入样例
1
5
输出样例
1
0



Consider the second test case:

The initial condition	   : 0 0 0 0 0 …
After the first operation  : 1 1 1 1 1 …
After the second operation : 1 0 1 0 1 …
After the third operation  : 1 0 0 0 1 …
After the fourth operation : 1 0 0 1 1 …
After the fifth operation  : 1 0 0 1 0 …

The later operations cannot change the condition of the fifth lamp any more. So the answer is 0.
提示
hint
来自杭电HDUOJ的附加信息
Author LL
Recommend linle

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

题目来源 校庆杯Warm Up

源链接: HDU-2053

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

共提交 0

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