TOJ 4118 IQ test
来源:互联网 发布:131458com淘宝账号查询 编辑:程序博客网 时间:2024/06/04 17:44
It's a simple problem;
The portal:http://acm.tju.edu.cn/toj/showp4118.html
#include <cstdio>#include <cstdlib>#include <cmath>#include <cstring>int f[3000005];int num[1000005];void Pre_deal(){ memset(f,0,sizeof(f)); memset(num,0,sizeof(num)); for(int i=1;i<=1000000;i++){ if(!f[i])f[2*i+2] = 1; } for(int i=1;i<=1000000;i++){ num[i] = num[i-1] + 1 - f[i]; }}void Deal_with(){ int n; while(~scanf("%d",&n)){ printf("%d\n",num[n]); }}int main(void){ Pre_deal(); Deal_with(); return 0;}
0 0
- TOJ 4118 IQ test
- IQ Test
- A. IQ test
- A. IQ Test
- LA 6449 IQ Test
- 周赛 IQ test
- A. IQ test
- codeforces 328A. IQ Test
- codeforces A. IQ test 题解
- CF —— IQ Test
- UVALive 6449 IQ Test --高斯消元?
- Codeforces 25A IQ test
- BNUOJ-4716题 IQ test
- 【CodeForces】[25A]IQ test
- IQ Test for Top500 Enterprise Cooperation
- CodeForces Testing Round #8 A.IQ Test
- Codeforces-287a C IQ Test
- 【水模拟】#25 A. IQ test
- muduo网络编程分包和解包(一)
- #26 Remove Duplicates from Sorted Array
- 每天一个linux命令(29):chgrp命令
- Hibernate异常:NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/
- gitosis权限控制
- TOJ 4118 IQ test
- 【Spark】Spark基本概念
- 黑马程序员——GUI图形用户界面-整理笔记
- listview中的控件点击
- 使用maven的tomcat:run进行web项目热部署
- Serializable:writeReplace
- 【Spark】弹性分布式数据集RDD概述
- Oracle成长点点滴滴(3)— 权限管理
- js性能调试