hdu 2053 Switch Game 水题一枚,鉴定完毕
Switch Game
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 10200 Accepted Submission(s): 6175
5
0
hint
Consider the second test case:
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cstdlib>
using namespace std; int num_Euler(int n)
{
int i;
int num,ans=;
for(i=;i*i<=n;i++)
{
if(n%i==)
{
num=;
while(n%i==)
{
n=n/i;
num++;
}
ans=ans*num;
}
}
if(n!=)
ans=ans*;
return ans;
}
int main()
{
int n;
while(scanf("%d",&n)>){
int m=num_Euler(n);
printf("%d\n",(m&));
}
return ;
}
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cstdlib>
using namespace std; bool dp[]; void init()
{
int i,j;
memset(dp,true,sizeof(dp));
for(i=;i<=;i++)
{
for(j=i;j<=;j=j+i)
if(dp[j]==true) dp[j]=false;
else dp[j]=true;
}
}
int main()
{
int n;
init();
while(scanf("%d",&n)>)
{
if(dp[n]==false)printf("0\n");
else printf("1\n");
}
return ;
}
hdu 2053 Switch Game 水题一枚,鉴定完毕的更多相关文章
- 杭电(hdu)2053 Switch Game 水题
Switch Game Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tota ...
- hdu 1106:排序(水题,字符串处理 + 排序)
排序 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submissi ...
- HDU 4950 Monster (水题)
Monster 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/I Description Teacher Mai has a k ...
- HDU 4813 Hard Code 水题
Hard Code Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.act ...
- HDU 4593 H - Robot 水题
H - RobotTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.act ...
- HDOJ/HDU 2560 Buildings(嗯~水题)
Problem Description We divide the HZNU Campus into N*M grids. As you can see from the picture below, ...
- HDOJ(HDU) 1859 最小长方形(水题、、)
Problem Description 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内.长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内 ...
- poj 2586 Y2K Accounting Bug(贪心算法,水题一枚)
#include <iostream> using namespace std; /*248K 32MS*/ int main() { int s,d; while(cin>> ...
- PAT甲题题解-1019. General Palindromic Number (20)-又是水题一枚
n转化为b进制的格式,问你该格式是否为回文数字(即正着写和倒着写一样)输出Yes或者No并且输出该格式又是水题... #include <iostream> #include <cs ...
随机推荐
- @perproty and @synthesize
.@property 是什么? @perperty 是声明属性的语法,他可以快速方便的为实例变量创建存取器,并允许我们通过点语法使用存取器 [存取器:用于获取和设置实例变量的方法,获取实例变量值得是g ...
- prezi破解教程
http://www.joenchen.com/archives/998 http://www.joenchen.com/archives/945 Prezi Desktop 4.7.5免注册无时间限 ...
- php4.3.4.4、apache2.0.4.8、mysql 4.0.26、window7 配置过程
apache的安装不需要过程,直接默认安装,下一步 下一步就Ok了. php4的安装: 1 将php-4.0.4-Win32.zip(最新版本4.0.4)解压缩到硬盘的一个目录中,例如解压到E:php ...
- 04---Net基础加强
字符串常用方法: 属性: Length获取字符串中字符的个数 IsNullOrEmpty() 静态方法,判断为null或者为“” ToCharArray() 将string转换为char[] To ...
- gulpfile.js
文件目录如上: 下载代码地址:https://github.com/lianbinghua/gulptest 切换目录:cd gulp 安装依赖包:npm install 编译文件:gulp或者gul ...
- Android2.2快速入门 zz
http://www.cnblogs.com/over140/archive/2010/09/27/1836567.html 前言 这是前段时间用于公司Android入门培训的资料,学习Android ...
- PAT乙级 1016. 部分A+B (15) C语言实现
1016. 部分A+B (15) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 正整数A的“DA(为1位整数)部 ...
- zw版【转发·台湾nvp系列例程】HALCON EquHistoImage(Delphi)
zw版[转发·台湾nvp系列例程]HALCON EquHistoImage(Delphi) zw版[转发·台湾nvp系列例程]HALCON EquHistoImage(Delphi) (Delphi ...
- 雅虎工程师提供的CSS初始化代码
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,b ...
- Yii增删改查操作
增: 1 第一种 $post=new Post; $post->title='sample post'; $post->content='content for the sample po ...