【HDOJ】【BestCoder Round #84】1004 Dertouzos
来源:互联网 发布:进口美工小号刀片 编辑:程序博客网 时间:2024/04/30 09:05
问题描述
正整数
输入描述
输入包含多组数据, 第一行包含一个整数
第一行包含两个整数
输出描述
对于每组数据, 输出一个整数.
我们反过来考虑,给定一个
以下为最终结论……
根据题目中给出的定义,我们可以知道,如果一个数
(如果
(类似的,我们可以知道如果
那么问题就是统计有多少质数
对于
(然而
(自己简单估计,应该是
#include<stdio.h>#define lim 100007 bool b[lim+1];int p[lim],n,d,T,tot;int main(){ for (int i=2;i<=lim;i++) if (!b[i]) for (int j=i<<1;j<=lim;j+=i) b[j]=1; for (int i=2;i<=lim;i++) if (!b[i]) p[tot++]=i; scanf("%d",&T); while(T--) { scanf("%d%d",&n,&d); int i; for (i=0;i<tot && d*p[i]<n;i++) if (d % p[i]==0) { i++; break; } printf("%d\n",i); }}
- 【HDOJ】【BestCoder Round #84】1004 Dertouzos
- BestCoder Round #84 1004Dertouzos
- BestCoder Round #84 Dertouzos
- BestCoder Round #84 &&HDU 5750 Dertouzos 【数论+暴力】
- HDU 5750 BestCoder Round #84 Dertouzos (素数筛选)
- 【HDOJ】【BestCoder Round #84】1001 Aaronson
- hdoj 5748 Bellovin (LIS) 【BestCoder Round #84 】
- 【HDU5750 BestCoder Round 84D】【数学 贪心 复杂度计算】Dertouzos 范围有多少数的最大真约数为d
- HDOJ 5750 Dertouzos
- Reading comprehension (BestCoder Round #8) (hdoj 4990)
- HDOJ-BestCoder Round #85 【5777 domino】
- BestCoder Round #84 1004 hdu 5750 数论
- BestCoder Round #84 题解
- BestCoder Round #84
- BestCoder Round #84
- BestCoder Round #84
- BestCoder Round #84 Bellovin
- BestCoder Round #84题解报告
- 同为javascript框架,react和angular各有什么优缺点,各自又适合什么开发场景?
- mysql 索引
- java的泛型和反射,多线程
- Leetcode 31. Next Permutation (Medium) (cpp)
- 应用的导航页
- 【HDOJ】【BestCoder Round #84】1004 Dertouzos
- 页面调度算法----百度2017暑期实习生编程题
- Mindjet MindManager abnormal program termination错误
- Enabling Stack Dumping in Linux Kernel
- Java的注解
- HDU 5546 Ancient Go(DFS)
- curl模拟post请求提交
- java异常
- jQuery Datatable后台分页