[ HDOJ 3826 ] Squarefree number】的更多相关文章

\(\\\) \(Description\) \(T\)组数据,每次给出一个正整数 \(N\) ,判断其是否能被任意一个完全平方数整除. \(T\le 20,N\le 10^{18}\) \(\\\) \(Solution\) 比较巧妙. 考虑一个数能被完全平方数整除,当且仅当对其分解质因数以后,至少有一个质数的指数\(\ge 2\). 借用试除法分解质因数的思路,大于\(\sqrt N\)的质因子至多只有一个.那么,大于 \(\sqrt[3] N\) 的质因数的平方整除 \(N\) 的个数至多…
题目链接 题意 : 给出一个数.问其能不能被任何一个平方数整除.如果可以则输出 No 即不是 Square-free Number .否则输出 Yes 分析 : 首先 N 有 1e18 那么大.不能暴力 根据唯一分解定理.任何数可以分解成若干素数乘积形式 N = p1^a1 + p2^a2 + p3^a3 ..... 那么可以利用这个特性来解决这个问题 首先可以知道其素因子肯定是不超过 1e6 的 那么对于 1e6 以内的素数我们先预处理出来 然后开始枚举.如果 N 能被两个或以上相同的素数整除…
题目传送门 /* 水题:判断前后的差值是否为1,b[i]记录差值,若没有找到,则是第一个出错 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <cmath> using namespace std; ; const int INF = 0x3f3f3f3f; int a…
题目链接 题意 : 定义不能被平方数整除的数为 Square-free Number 定义 F(i) = 有几对不同的 a 和 b 使得 i = a * b 且 a .b 都是 Square-free 给出一个 N 求 分析 : 首先 Square-free 有一个性质 就是用唯一分解定理将 Square-free Number 分解后 素因数的指数都是 1 那么对于 a.b 是 Square-free Number 相乘 a * b 得出的 i 其不会有素因子的指数超过 2 然后你要熟悉欧拉筛…
数位DP... Balanced Number Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1337    Accepted Submission(s): 583 Problem Description A balanced number is a non-negative integer that can be balanced…
Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5930    Accepted Submission(s): 4146 Problem Description As we know, Big Number is always troublesome. But it's really important in our…
Problem Description In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of…
Problem Description Welcome to 2006'4 computer college programming contest! Specially, I give my best regards to all freshmen! You are the future of HDU ACM! And now, I must tell you that ACM problems are always not so easy, but, except this one- Ha-…
当进制转换后所剩下的为数较少时(2位.3位),相应的base都比較大.能够用数学的方法计算出来. 预处理掉转换后位数为3位后,base就小于n的3次方了,能够暴力计算. . .. Lucky Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 521    Accepted Submission(s): 150 Probl…
静态区间第K小....划分树裸题 Kth number Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5341    Accepted Submission(s): 1733 Problem Description Give you a sequence and ask you the kth big number of a int…