算法题:CodeForces 236B - Easy Number Challenge(数论:求因子个数)2014-03-17 csdn博客 shuangde800链接:http://www.codeforces.com/problemset/problem/236/B题目:B. Easy Number Challengetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet"s denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum:

Find the sum modulo 1073741824 (230).InputThe first line contains three space-separated integers a, b and c (1≤a,b,c≤100).OutputPrint a single integer — the required sum modulo 1073741824 (230).Sample test(s)input2 2 2output20input5 6 7output1520NoteFor the first example. d(1·1·1)=d(1)=1;
d(1·1·2)=d(2)=2;
d(1·2·1)=d(2)=2;
d(1·2·2)=d(4)=3;
d(2·1·1)=d(2)=2;
d(2·1·2)=d(4)=3;
d(2·2·1)=d(4)=3;
d(2·2·2)=d(8)=4.So the result is 1+2+2+3+2+3+3+4=20.分析与总结:裸的求因子个数,数据比较水可以暴力过,但是只要给个100 100 100, 就会因TLE被别人hack掉的 。对于我这种数学弱逼,打CF时只能临时百度个更高效的的方法了...条件:给定任意一个一个正整数N要求:求其因子的个数首先给出结论:对于任意的整型N,分解质因数得到N= P1^x1 * P2^x2* …… * Pn^xn;则N的因子个数M为 M=(x1+1) * (x2+1) * …… *(xn+1);证明过程:首先 举个例子吧24 = 2^3 * 3^1;其质因子有:为2和3 指数为 3和1那么对于2 有0 1 2 3四种指数选择,对于3 有0 1两种指数选择所以 就是4 * 2 = 8 个因子个数如果还是不懂,那么我们就列举出来吧2 32^0*3^0=1 2^0*3^1=32^1*3^0=2 2^1*3^1=62^2*3^0=4 2^2*3^1=122^3*3^0=8 2^3*3^1=24