博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU 5428-The Factor(分解质因子)
阅读量:2029 次
发布时间:2019-04-28

本文共 691 字,大约阅读时间需要 2 分钟。

题目地址:

题意:
这里写图片描述
思路:分解每个数的质因子,将他们保存在sprime数组中(可重复),如果个数小于两个,输出-1,否则的话将sprime数组排序,输出最小的两个数的乘积

#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#pragma comment(linker, "/STACK:102400000,102400000")using namespace std;typedef long long LL;const int inf=0x3f3f3f3f;const double pi= acos(-1.0);const double esp=1e-6;using namespace std;const int Maxn=1e5+10;LL prime[Maxn];LL sprime[Maxn];LL a[Maxn];bitset
pri;LL k,cnt;void is_prime(){ pri.set(); for(LL i=2; i
1) sprime[cnt++]=n;}int main(){ int T,n,i; is_prime(); scanf("%d",&T); while(T--){ cnt=0; scanf("%d",&n); for(int i=0;i
你可能感兴趣的文章
Spring Boot 入门之基础篇(一)
查看>>
Spring Boot 入门之 Web 篇(二)
查看>>
Spring Boot 入门之持久层篇(三)
查看>>
Spring Boot 入门之缓存和 NoSQL 篇(四)
查看>>
Shiro 基础教程
查看>>
String、String.valueOf、toString 它们三者的区别总结
查看>>
java中什么叫引用
查看>>
Java-空字符串""和null的区别
查看>>
@SuppressWarnings注解
查看>>
Java中URLDecoder的编码问题
查看>>
Eclipse 常用快捷键和使用技巧
查看>>
Node.js安装及环境配置之Windows篇
查看>>
Oracle 创建索引语法
查看>>
Springboot系列:@SpringBootApplication注解
查看>>
SpringBoot注解之@SpringBootApplication的使用
查看>>
jsonutil 工具类的使用
查看>>
数据库连接池选择及开发配置
查看>>
微服务架构实施原理
查看>>
UUID.randomUUID()简单介绍
查看>>
containsKey方法——判断是否包含指定的键名
查看>>