http://acm.hdu.edu.cn/showproblem.php?pid=1492
The main topic: give you a n this n his vegetarian factor is only 2 3 5 7 This four number no other factor factor n is 2 of the 64-th
Analysis: Just ask for the number of his factor to multiply each plus one.
#include <cstdio>#include<cstring>#include<stack>#include<vector>#include<queue>#include<cmath>#include<cstdlib>#include<iostream>#include<algorithm>using namespacestd;#defineN 30#defineMemset (A, B) memset (A,b,sizeof (a))intA[n];voidSerch (Long Long intN) {memset (A,0); intI=0; intb[4]={2,3,5,7}; while(n!=1) { if(n%b[i]==0) {A[b[i]]++; N=n/B[i]; } Else{i++; } }}intMain () {Long Long intN; while(SCANF ("%lld",&N), N) {serch (n); Long Long intSum= (a[2]+1) * (a[3]+1) * (a[5]+1) * (a[7]+1); printf ("%lld\n", sum); } return 0;}
The number of divisors (approximate) about Humble numbers--hdu1492