HDU 2053 JAVA
来源:互联网 发布:inapp软件 编辑:程序博客网 时间:2024/06/03 04:22
Problem Description
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 ).
Input
Each test case contains only a number n ( 0< n<= 10^5) in a line.
Output
Output the condition of the n-th lamp after infinity operations ( 0 - off, 1 - on ).
Sample Input
1
5
Sample Output
1
0
import java.util.*;class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ int n=sc.nextInt(); int m=(int)Math.sqrt(n); if(n==m*m){ System.out.println("1"); }else{ System.out.println("0"); } } }}
0 0
- HDU 2053 JAVA
- hdu 2053 Switch Game(java)
- hdu acm hdu 2115 Java
- Exponentiation hdu 1063 java
- hdu 1313 (Java)
- 【Java】hdu 4043
- hdu 1242 Rescue<java>
- HDU 1002 JAVA
- hdu 2092(java)
- hdu 1063 java 高精度
- hdu 1106(java)
- hdu 1073(java)
- HDU-4762 Java高精度
- hdu 1002 java
- hdu 1089 java
- JAVA hdu 2192 MagicBuilding
- hdu 1001 java
- hdu 1002 java
- sdutacm-Sorting It All Out
- 【剑指offer】面试题17:合并两个排序的链表
- ARM流水线
- Morris遍历
- 网络爬虫之初识网络爬虫
- HDU 2053 JAVA
- eclipse安装spring插件
- 【Unity优化】Unity中究竟能不能使用foreach?
- sdutacm-小雷的冰茶几
- 前端各种页面跳转
- Android 蓝牙 BLE蓝牙 浅析
- Mysql_主从_配置详解
- HDU 2054 JAVA
- docker学习之容器