GT and numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2772    Accepted Submission(s): 688 Problem Description You are given two numbers N and M. Every step you can get a new N in the wa…
https://vjudge.net/problem/CodeForces-1047C 题意:有n个数,他们有个最大公约数设为maxxgcd,要删去一些数,使得剩下的数的gcd大于maxxgcd. 解题:先求出原来的数的最大gcd,每个数除以maxxgcd,之后所有数的gcd为1.用分解质因数,最多数拥有的质因子便是新的gcd,大于1就行,除掉那些不含该质因子的数. #include<stdio.h> #include<iostream> #include<algorithm…
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, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Now given a humble number, please write a program t…
题意:给出一个x 可以做两种操作  ①sqrt(x)  注意必须是完全平方数  ② x*=k  (k为任意数)  问能达到的最小的x是多少 思路: 由题意以及 操作  应该联想到唯一分解定理   经过分析可以知道   ②操作最多使用一次  将x分解成一系列素数乘积的时候  只要看最高幂次离哪个二的幂近(只取上界) 并且把所以素因子都凑成找到的这个二的幂  只要x*=k一步就可以凑成  然后一直操作①模拟即可 而如果刚好全部都相等并且都是2的幂次 那么直接一直操作①模拟即可 #include<bi…
题目描述 Hanks 博士是 BT (Bio-Tech,生物技术) 领域的知名专家,他的儿子名叫 Hankson.现 在,刚刚放学回家的 Hankson 正在思考一个有趣的问题. 今天在课堂上,老师讲解了如何求两个正整数 c1 和 c2 的最大公约数和最小公倍数.现 在 Hankson 认为自己已经熟练地掌握了这些知识,他开始思考一个“求公约数”和“求公 倍数”之类问题的“逆问题”,这个问题是这样的:已知正整数 a0,a1,b0,b1,设某未知正整 数 x 满足: 1. x 和 a0 的最大公约…
UVA - 10375 Choose and divide Choose and divide Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4053   Accepted: 1318 Description The binomial coefficient C(m,n) is defined as m! C(m,n) = -------- n!(m-n)! Given four natural numbers p, q…
Sumdiv Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 17387   Accepted: 4374 Description Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 99…
A - (例题)整数分解 Crawling in process... Crawling failed Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Description Find the result of the following code: long long pairsFormLCM( int n ) {    long long res = 0;   …
Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901). Input The only line contains the two natural numbers A and B, (0 <= A,B <= 50000000)separated by…
GCD and LCM Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 3409    Accepted Submission(s): 1503 Problem Description Given two positive integers G and L, could you tell me how many solutions of…