hdu 2521 反素数 (水)
来源:互联网 发布:linux内存管理 编辑:程序博客网 时间:2024/05/22 03:46
点击打开链接
题目具有迷惑性,第一句的反素素与题目没关系!
题目意思是求,一个区间中的最大素数
#include<stdio.h>int main(){int i,j,n,m,max,t,tt,count[5555];count[0]=0;count[1]=1;count[2]=2;count[3]=2;for(i=4;i<=5001;i++){count[i]=2;for(j=2;j<i/2;j++)if(i%j==0)count[i]++;}scanf("%d",&t);while(t--){scanf("%d%d",&n,&m);max=0;tt=n;for(i=n;i<=m;i++)if(count[i]>max){max=count[i];tt=i;}printf("%d\n",tt);}return 0;}
- hdu 2521 反素数 (水)
- 【HDU 2521】反素数(水)
- hdu 2521(反素数)
- HDU 2521 反素数(区间反素数)
- 【素数】-HDU-2521-反素数
- HDU 2521 反素数
- HDU 2521 反素数
- hdu 2521 反素数
- hdu-2521-反素数
- HDU 2521 反素数
- hdu-2521-反素数
- hdu 2521 反素数
- HDU 2521 反素数
- hdu 2521 反素数
- HDU 2521 反素数
- hdu 2521 反素数
- HDU 2521 反素数
- HDU 2521 反素数(分解质因数)
- hdu 2560 Buildings (水)
- BIEE建模技术之-时间事实表
- hdu 2740 Root of the Problem (水)
- UVa 11054 - Wine trading in Gergovia
- CMD命令之BAT脚本语法详解
- hdu 2521 反素数 (水)
- postgresql 插入字符串有空格,见图片
- UVa 10718 - Bit Mask
- java.text.Collator 类的具体使用方法
- 【线段树】 hdu4325 Flowers
- hdu2734 Quicksum (水)
- UVa 10400 - Game Show Math
- UVa 10602 - Editor Nottoobad
- hdu 2265 Encoding The Diary (水)