Test Instructions RT
is to pay attention to the annotated where--!
1#include <cstdio>2#include <cstring>3#include <algorithm>4#include <iostream>5#include <cmath>6#include <map>7#include <queue>8 9 using namespacestd;Ten OnetypedefLong Longll; A - Const intx =1000000000; - BOOLispri[32000]; the intpri[3410]; - intC; - - voidInit () + { -memset (Ispri,0,sizeof(ISPRI)); +c =0; A intm = (int) (sqrt (x+0.5)+0.5); at for(intI=2; i<=m;i++) - { - if(!Ispri[i]) - { -Pri[c++] =i; - for(intj=i*2; j<=m;j+=i) in { -ISPRI[J] =true; to } + } - } the } * $ voidSolveintnum)Panax Notoginseng { - intAns =1; the for(intI=0; i<c;i++) + { A if(Pri[i]<=num && num%pri[i]==0) the { + intCNT =0; - while(num>0&& num%pri[i]==0) $ { $cnt++; -Num/=Pri[i]; - } theAns*= (1+CNT); - }Wuyi } the //if it is greater than the maximum value of the hit Prime table int (sqrt (x+0.5) +0.5) and a prime number less than x - if(num!=1) ans*=2;//!!! Wuprintf"%d\n", ans); - } About $ intMain () - { - intN,num; - init (); A while(~SCANF ("%d",&N)) + { the for(intI=0; i<n;i++) - { $scanf"%d",&num); the solve (num); the } the } the return 0; -}
Topic 1087: Number of approximate numbers