http://acm.hdu.edu.cn/showproblem.php?pid=1337

 #include <cstdio>
#include <cstring>
#define maxn 200
using namespace std;
int main()
{
int t;
int a[maxn];
scanf("%d",&t);
int n;
while(t--)
{
scanf("%d",&n);
for(int i=; i<=maxn; i++) a[i]=;
for(int i=; i<=n; i++)
{
for(int j=i; j<=n; j+=i)
{
a[j]^=;
}
}
int ans=;
for(int i=; i<=n; i++)
{
if(!a[i]) ans++;
}
printf("%d\n",ans);
}
return ;
}

hdu 1337 The Drunk Jailer的更多相关文章

  1. THE DRUNK JAILER 分类: POJ 2015-06-10 14:50 13人阅读 评论(0) 收藏

    THE DRUNK JAILER Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 24918   Accepted: 1563 ...

  2. poj 1218 THE DRUNK JAILER【水题】

    THE DRUNK JAILER Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 25124   Accepted: 1576 ...

  3. poj 1218 THE DRUNK JAILER

    THE DRUNK JAILER Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 23358   Accepted: 1472 ...

  4. [ACM] POJ 1218 THE DRUNK JAILER (关灯问题)

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/sr19930829/article/details/37727417 THE DRUNK JAILE ...

  5. HDU 1337 && POJ 1218&& zju 1350 方法总结

    题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1337 杭电 http://poj.org/problem?id=1218清华 http://acm.zj ...

  6. 2076. The Drunk Jailer

    Problem A certain prison contains a long hall of n cells, each right next to each other. Each cell h ...

  7. POJ 1218 THE DRUNK JAILER(类开灯问题,完全平方数)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2188 题目大意:n为5-100之间的一个数,代表有多少间牢房,刚开始所有房间打开,第一轮2的倍数的房间 ...

  8. Poj1218_THE DRUNK JAILER(水题)

    一.Description A certain prison contains a long hall of n cells, each right next to each other. Each ...

  9. ZOJ Problem Set - 1350 The Drunk Jailer ac代码 memset

    这是一道很简单的题目,题目大概意思说下:就是有n个监狱(编号从1到n),第一次全部打开,第二次打开编号为2的倍数的,第三次打开编号为3的倍数的,以此类推...最后问你有几个监狱是打开的 题目中我使用了 ...

随机推荐

  1. repter导出到Excel

     ;                 ,  * );                 sheet1.SetColumnWidth(,  * );                 sheet1.SetC ...

  2. CString 的一些事

    MFC Visual Studio 2008 CString 的 Format 中不能这样存在str.Format(_T("Cool(\%)"));  或者 str.Format( ...

  3. python字符集选择

    # coding=utf8 或者 # -*- coding:utf-8 -*- 在python2 中默认是ASCII码的字符集,但可以引入其他的字符集  这个需要在头信息中引入: 而在python3中 ...

  4. java保留有效数字

    DecimalFormat df=DecimalFormat("######0.0") double d = df.format(xx): 保留一位就是"######0. ...

  5. AC Milan VS Juventus(模拟)

    AC Milan VS Juventus Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Oth ...

  6. jsp当参数为空的时候默认显示值

    当${business.branchName }为空或者不存在的时候显示“请选择门店” <c:out value="${business.branchName }" defa ...

  7. Linux远程登录

    Linux远程登录 远程登录 关闭linux的防火墙 /etc/init.d/iptables stop 启动VNC服务器 Vncserver & 然后记住desktop is localho ...

  8. stm32之通用定时器TIM

    STM32系列的CPU,有多达8个定时器: 1.其中TMI1和TIM8是能够产生三对PWM互补输出的高级定时器,常用于三相电机的驱动:它们的时钟有APB2的输出产生: 2.其它6个为普通定时器,时钟由 ...

  9. NET中级课--设计模式1

    1.分类 创建型  结构型  行为型 2.总体思路 使用接口和抽象类 3.创建型 工厂: 单例:整个系统中对象是唯一的或固定数目的对象如对象池 4.结构型

  10. .net批量删除和添加

    往页面上拖一个GridView,设置好数据源,并为GridView添加一个模板列,往模板列里添加一个chekcbox,比如下面的代码 <asp:GridView ID="GridVie ...