HDU_2053
hint
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.
#include <cstdio>
int main()
{
int n, ans;
while(~scanf("%d",&n))
{
ans=;
for(int i=;i<=n;i++)
{
if(n%i==)
{
ans=-*ans;
}
}
printf(ans==?"0\n":"1\n");
}
return ;
}
HDU_2053的更多相关文章
随机推荐
- CF380C Sereja and Brackets [想法+线段树]
题意: 给出一串括号 给出一些询问,问某个区间[l,r]内的能合法匹配的括号数有多少个 分析: 我们能够实现处理两个数组 sum[i] 1....i中已经能匹配的右括号的数目 left[i] 1... ...
- java实现excel的导入导出(poi详解)
经过两天的研究,现在对excel导出有点心得了.我们使用的excel导出的jar包是poi这个阿帕奇公司的一个项目,后来被扩充了.是比较好用的excel导出工具. 下面来认识一下这个它吧. 我们知道要 ...
- StarUML中时序图添加小人
转载于 http://blog.csdn.net/longyuhome/article/details/9011629 在看时序图的例子的时候,发现有些的时序图上有小人的图标,可是一些UML工具却没有 ...
- hdu 2201
题意: 一共有n个人,m表示第m个人,然后问你第i个人不做到m号位置的概率,最后相乘.... 水题(注意下格式输出) AC代码: #include <iostream> using nam ...
- ASP.NET实现省市区三级联动(局部刷新)
跟前一篇ASP.NET实现年月日三级联动(局部刷新)一样,没什么技术含量,直接上代码 <asp:ScriptManager ID="ScriptManager1" runat ...
- osgi与webservice
osgi简介: http://osgia.com/ http://blog.csdn.net/xiaokui008/article/details/9662933 http://wdhdd889.it ...
- Jenkins学习之——(3)将项目发送到tomcat
本章节将讲解如何将项目发送到tomcat,实现自动部署. 我只将一个测试的maven项目托管到github上的,不了解git获github的朋友自己百度一下,我也写了一些关于git的文章,希望大家可以 ...
- java事件处理3
鼠标拖动事件 接口MouseMotionListener 两个方法 mouseDragged(MouseEvent)//拖动鼠标 mouseMoved(MouseEvent)//移动鼠标 一个拖动按钮 ...
- TComboBox组件的重要属性
TComboBox组件的重要属性 CharCase--------此属性用于设置编辑框内文字的大小写DropDownCount---此属性用于设置当用户下拉组合框时不需要加滚动条就能显示的项的个数Dr ...
- js 浏览器版本检测
整理了一下浏览器检测的js脚本 分享给大家 浏览器检测一般都是在网页打开的时候执行 使用js的闭包来实现页面加载以后执行的脚本 (function(){ //页面加载后执行的脚本 })() ; 检测浏 ...