HDU 5428 The Factor】的更多相关文章

题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5428 The Factor  Accepts: 101  Submissions: 811  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 有一个数列,FancyCoder沉迷于研究这个数列的乘积相关问题,但是它们的乘积往往非常大.幸运的是,FancyCoder只需要找到…
The Factor  Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=628&pid=1001 Description 有一个数列,FancyCoder沉迷于研究这个数列的乘积相关问题,但是它们的乘积往往非常大.幸运的是,FancyCoder只需要找到这个巨大乘积的最小的满足如下规则的因子:这个因子包含大于两个因子(包括…
Problem Description There is a sequence of n positive integers. Fancycoder is addicted to learn their product, but this product may be extremely huge! However, it is lucky that FancyCoder only needs to find out one factor of this huge product: the sm…
话说这题意真的是好难懂啊,尽管搜到了中文题意,然而还是没懂,最后看到了一个题解才懂的.http://www.cnblogs.com/Apro/p/4784808.html#3470972 题意:给出n个数,问这n个数的乘积中最小的有至少三个因子的因子. 解法:除了1和质数的正整数都有至少三个因子,所以只要求那个乘积里最小的不为1的非质数因子就可以了,对每个数分解质因子,所有质因子中最小的两个之积即为答案,如果找不到两个质因子则不存在答案.注意longlong!注意longlong!注意longl…
题意:给出n个数,问这n个数的乘积中至少有三个因子的最小因子.若不存在这样的因子,则输出 -1: 思路:求出每个数的最小的两个素因数,然后输出其中最小的两个数的乘积. 代码: #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<queue> #include<algorithm> #include<cmath> #…
The Factor  Accepts: 101  Submissions: 811  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 有一个数列,FancyCoder沉迷于研究这个数列的乘积相关问题,但是它们的乘积往往非常大.幸运的是,FancyCoder只需要找到这个巨大乘积的最小的满足如下规则的因子:这个因子包含大于两个因子(包括它本身:比如,4有3个因子,因此它是…
                                                                                               The Factor  Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=628&pid=1001 Description 有一个数列,…
Problem Description To improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, he is unaware that the cows interpret some serial numbers as be…
http://acm.hdu.edu.cn/showproblem.php?pid=1627 给定 n 和 L 找出第n个范围在0-L之内的字符串,字符串要求没有相邻的子串是相同的. 按照格式输出. 这个题的关键在于判断字符串是否是符合要求的字符串. 枚举字符串所有子串可能的长度,然后判断即可. #include <iostream> #include <cstdio> #include <cmath> #include <vector> #include…
类似于素数打表. #include <cstdio> #include <cstring> #include <algorithm> #define maxn 1000100 using namespace std; int f[maxn]; void inti() { ; ; i<maxn; i++) { ) { num++; for(int j=i; j<maxn; j+=i) { f[j]=num; } } } } int main() { int n…