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的更多相关文章
随机推荐
- C primer plus 读书笔记第四章
			
本章的标题是字符串的格式化输入/输出,重点介绍输入和输出. 本章的第一段示例代码和上一张示例代码很相近,代码就不贴了,新出现的特性是使用了一个数组来存放字符串,C预处理命令和strlen()函数. 下 ...
 - 95秀-PullToRefreshListView 示例
			
正在加载.暂无数据页面 public class RefreshGuideTool { private RelativeLayout rl_loading_guide;//整个View ...
 - 关于IIS部署成功后,局域网其他用户无法访问的问题解决方法
			
关于win7部署iis后,局域网的其他用户不能访问的问题. 在win7系统中,部署好iis后,自己本地可以发布和预览.但在局域网中的其他用户不可以访问.下面说一下这个原因. 这是因为win7自带的 ...
 - MySQL性能调优与架构设计读书笔记
			
可扩展性设计之数据切分 14.2 数据的垂直切分 如何切分,切分到什么样的程度,是一个比较考验人的难题.只能在实际的应用场景中通过平衡各方面的成本和利益,才能分析出一个真正适合自己的拆分方案. 14. ...
 - 匹配不含有某个信息的sql语句写法
			
SELECT id,order_id,flight_info FROM order_flights WHERE mark=0 AND flight_info REGEXP '[^() DAY)]' O ...
 - Arcgis Android 基本概念 - 浅谈
			
MapView MapView 是 Android 中 ViewGroup的子类,也是 ArcGIS Runtime SDK for Android 中的地图容器,与很多 ArcGIS API ...
 - start with connect by prior学习
			
这是oracle中的树查询,查询出来的数据会根据上下级组成树的结构.select * from mw_sys.mwt_pd_deps start with obj_id = '63EBEC8E-E76 ...
 - shell 中 2>&1 的使用
			
一 相关知识 1)默认地,标准的输入为键盘,但是也可以来自文件或管道(pipe |). 2)默认地,标准的输出为终端(terminal),但是也可以重定向到文件,管道或后引号(backquotes ` ...
 - Mac系统配置多个git账号
			
1.进入ssh目录 #cd ~/.ssh/ 2.用ssh-keygen命令生成一组新的id_rsa_new和id_rsa_new.pub #ssh-keygen -t rsa -C"new ...
 - JavaWeb学习笔记之Servlet(二)
			
1. GenericServlet 抽象类: 1). 是一个 Serlvet. 是 Servlet 接口和 ServletConfig 接口的实现类. 但是一个抽象类. 其中的 service 方法 ...