hdu 5505 GT and numbers】的更多相关文章

GT and numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1520    Accepted Submission(s): 381 Problem Description You are given two numbers N and M. Every step you can get a new N in the wa…
GT and numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 683    Accepted Submission(s): 190 Problem Description You are given two numbers N and M. Every step you can get a new N in the way…
题目链接 : http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=641&pid=1002 思路 : N有若干个质因子, N = a^b * c^d * e^f...... M也有若干个质因子, M = a^(b+k) * c(d+k1) * e^(f+k2)...... N能到达M的条件是它们的质因子必须完全相同 N每次可以乘上它的若干个质因子, 直到这个质因子的幂次等于M这个质因子的幂次 考虑这样一个事实,…
题意: 给你a和b,a每次和它的因子相乘得到一个新的a,求多少次后可以得到b. 输入样例 3 1 1 1 2 2 4 输出样例 0 -1 1 思路: 每次找出a和b/a的最大公约数(即当前a想得到b能乘的最大数),再进行判断. 第一次直接暴力搞,超时了,发现题意理解错了 T_T. 用unsign按着题意做即可. #include <iostream> #include <cstdio> #include <vector> #include <queue> #…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5272 Dylans loves numbers Description Who is Dylans?You can find his ID in UOJ and Codeforces.His another ID is s1451900 in BestCoder. And now today's problems are all about him. Dylans is given a number…
Dylans loves numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5272 Description Dylans是谁?你可以在 UOJ 和 Codeforces上看到他.在BestCoder里,他有另外一个ID:s1451900.今天的题目都和他有关哦.Dylans得到了一个数N.他想知道N的二进制中有几组1.如果两个1之间有若干个(至少一个)0…
Humble Numbers Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1058 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9…
Quite Good Numbers Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KB Total submit users: 77, Accepted users: 57 Problem 12876 : No special judgement Problem description A "perfect" number is an integer that is equal to the sum…
GT and numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1818    Accepted Submission(s): 490 Problem Description You are given two numbers N and M. Every step you can get a new N in the wa…
GT and numbers 问题描述 给出两个数NN和MM. NN每次可以乘上一个自己的因数变成新的NN. 求最初的NN到MM至少需要几步. 如果永远也到不了输出-1−1. 输入描述 第一行读入一个数TT表示数据组数. 接下来TT行,每行两个数NN和MM. T\leq1000T≤1000, 1\leq N \leq 10000001≤N≤1000000,1 \leq M \leq 2^{63}1≤M≤2​63​​. 注意M的范围.hack时建议输出最后一行的行末回车;每一行的结尾不要输出空格.…