id
int32
0
32.5k
code
stringlengths
95
8.4k
label
stringclasses
65 values
400
int sdw(int a,int b) { int i; int m=1; for(i=a;i<b/2;i++) { if(b%i==0) { if(i<=b/i) m=sdw(i,b/i)+m; } } return m; } int main() { int n,i,p,b; int a[1000]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { b=a[i]; p=sdw(2,b); printf("%d\n",p); } return 0; }
1
401
int num; int wrh(int n,int r,int b[200],int y,int a) { int i; for( i = y;i <= a/2;i ++ ) { if ( r % i == 0) { b[n] = i; int now = 1,j; for ( j = 1;j <= n;j ++ ) now = now * b[j]; if ( now == a) { num ++; break; } if ( now > a) break; else wrh(n + 1,r / i,b,i,a); } } return 0; } int main() { int s,a,b[200]; cin >> s; while (s > 0) { num = 0; cin >> a; wrh(1,a,b,2,a); cout << num + 1<<endl; s --; } return 0; }
1
402
int count; void fun(int i, int j) { int k; for(k=i; k<=sqrt(j); k++) { if(j%k == 0) { count++; fun(k,j/k); } } } int main() { int N,turn,c; scanf("%d",&turn); for(c=1;c<=turn;c++) { int n,i; scanf("%d",&n); for(i=2; i<=sqrt(n); i++) { if(n%i == 0) { count++; fun(i,n/i); } } printf("%d\n",count+1); count=0; } }
1
403
/* * wanyi.cpp * * Created on: 2012-11-20 * Author: 7 */ int t=1; void fen(int n,int i) { for(i=i;i*i<=n;i++) { if(n%i==0) { fen(n/i,i); t++; } } } int main() { int k; cin>>k; while(k--) { int n; cin>>n; t=1; fen(n,2); cout<<t<<endl; } }
1
404
int f(int n,int k){ if(n<k)return 0; int i,s=1; for(i=k;i<n;i++){ if(n%i==0)s+=f(n/i,i); } return s; } int main(){ int m,n,i,ans,s; scanf("%d",&m); while(m--){ scanf("%d",&n); printf("%d\n",f(n,2)); } return 0; }
1
405
int a; int res; int sum; void dfs(int cnt){ if(cnt*sum==a){res++; return;} if(cnt*sum<a){ sum*=cnt; int j=a/sum; for(int i=cnt;i<=j;i++) dfs(i); sum/=cnt; return; } } int main(){ int nCases; scanf("%d",&nCases); for(int i=0;i<nCases;i++){ scanf("%d",&a); res=0; sum=1; for(int i=2;i<=a;i++) dfs(i); printf("%d\n",res); } return 0; }
1
406
int num=0; int solution(int a,int b){ for(int i = b; i <= a; i++){ if(a%i == 0){ a=a/i; if(a == 1) num++; else num=solution(a,i); a=a*i; } } return num; } int main(){ int n; cin>>n; for(int i=0;i<n;i++){ int a; cin>>a; num=0; cout<<solution(a,2)<<endl; } return 0; }
1
407
// // main.cpp // HomeWork_11.14.Functions // ???? // Created by ??? on 11/19/12. // Copyright (c) 2012 airjcy. All rights reserved. // //#include <string> //??n???????????from int num; void divide(int n,int from) { int i; for (i = from; i < n; i ++) { if (n % i == 0) { if (n / i < i) { return; } num ++; divide(n / i, i); } } } // 20 2 10 2 2 5 4 5 5 4 int main(int argc, const char * argv[]) { int n; cin >> n; int i; int numberToDivide; for (i = 0; i < n; i++) { cin >> numberToDivide; num = 0; divide(numberToDivide, 2); cout << num + 1 << endl; } // num =0; // divide(20, 2); // cout << num + 1; }
1
408
int main() { int f(int a,int b); int n,m,i,d; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&m); d=f(m,2); printf("%d\n",d); } return 0; } int f(int a,int b) { int t=1,k,j; for(j=b;j<a;j++) { if(a%j==0&&a/j>=j) k=f(a/j,j); else k=0; t=t+k; } return t; }
1
409
//*************************************** //* ?????2010?12?01? * //* ????????? * //* ????? ???1000012902 * //*************************************** int factors(int, int, int); //????factors????????????? int main() { int num, n, i, j, b[10000]; cin >> n; //?????? for (i = 0; i < n; i++) { cin >> num; int part = 0; //?????????? int t = num; //???? //??????1???????????? for (j = 2; j <= num; j++) { while (t % j == 0) { t /= j; part++; } } b[i] = factors(1, part, num); //?????????????, ?????????? } //????????? for (i = 0; i < n; i++) { cout << b[i] << endl; } return 0; } //factor1????????????????????factor1, part??????????????????????????, num???????? int factors(int factor1, int part, int num) { int sum = 0; //????????0, ???0 if (num < factor1) //?????????????????, ???0????????????? return 0; if (part == 1) //?????????, ??1?????????? return 1; //???????????????????????????????????????????, ???????? for (int i = factor1; i <= num; i++) if (num % i == 0) sum = sum + factors(i, part - 1, num / i); return sum; }
1
410
int Fz(int,int); int main() { int n,num[1000]; cin>>n; for(int i=0;i<n;i++) { int a; cin>>a; num[i]=Fz(a,2); } for(int i=0;i<n;i++){ cout<<num[i]<<endl; } return 0; } int Fz(int x,int m) { int s=1,i; int y=(int)sqrt((double)x); for(i=m;i<=y;i++) { if(x%i==0) { s=s+Fz(x/i,i); } } return s; }
1
411
int counter=1;//??????????? void abc(int a,int b) { int i; for(i=b;i<=a;i++)//??????????? { if(a%i==0&&(a/i)>=i)//???????????????????????????????????? { counter++; abc(a/i,i); } } } int main() { int t,x; cin>>t; for(x=1;x<=t;x++)//????????????????? { counter=1;//?????????????????????????????????????????? int m; cin>>m;//???? abc(m,2);//???? cout<<counter<<endl;//????? } return 0; }
1
412
//******************************************************** //* ???:1.cpp * //* ?????? 1200012948 * //* ????: 2012 11 25 * //* ????:???? * //******************************************************** int b, j; int a[1000] = {0}; //a?????? void fjys(int); int main() { int n, i, x; cin >> n; for (i = 1; i <= n; i++) { j = 0; b = 0; memset (a, 0, sizeof(a)); cin >> x; fjys (x); cout << b << endl; } return 0; } void fjys(int x) { int i, n1; for (i = 2; i <= x; i++) //?2???? { if (x % i == 0 && i >= a[j]) { a[++j] = i; n1 = x / i; if(n1 == 1) //???? { b++; //?? } else { fjys(n1); } j--; } } return; }
1
413
int main() { int f(int x,int y); int n,i; int a[100]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); printf("%d\n",f(a[i],2)); } scanf("%d",&i); return 0; } int f(int x,int y) { int s,j,k,l,m,n; if(x==1) s=1; else if(y>x) s=0; else { for(l=1;l<=x;l++) { k=0; if(x%l==0) k=k+1; } if(k==2) s=1; else { s=0; for(j=y;j<=x;j++) { if(x%j==0){ s=s+f(x/j,j);} } } } return s; }
1
414
int fenjie(int , int); int fenjie(int q1, int n1) { int s1, i1; if (q1 > n1) return 0; else { s1 = 0; for (i1 = q1; i1 <= n1; i1++) { if ((i1 >= 2) && (n1%i1 == 0) && (n1/i1 >= i1)) { s1++; s1 = s1 + fenjie(i1, n1 / i1); } } return s1; } } int main() { int m, i, n; cin >> m; for (i = 1; i <= m; i++) { cin >> n; cout << fenjie(1,n)+1 << endl; } return 0; }
1
415
void f(int,int); int sum=0,res=1; int main() { int n,a,i,j; cin>>n; for(i=0;i<n;i++) //n??? { res=1; //??????a=a cin>>a; for(j=2;j<=(int)sqrt((float)a);j++) //?????? { if(a%j==0) { sum=0; f(a/j,j); //???????? res+=sum; } } cout<<res<<endl; } return 0; } void f(int x,int y) { if(x==1) sum++; while(y<=x) //????????????? { if(x%y==0) f(x/y,y); y++; } return; }
1
416
int num; main() { void fenjie(int x,int qi); int n,k,a; scanf("%d",&n); for(k=1;k<=n;k++) { num=0; scanf("%d",&a); fenjie(a,2); printf("%d\n",num); } } void fenjie(int x,int qi) { if(x==1) num++; else { for(int i=qi;i<=x;i++) { if(x%i==0) fenjie(x/i,i); } } }
1
417
/************************/ /* ???? */ /* ??? pyyaoer */ /* ?? 2011.11.26 */ /************************/ void yinshu(int); int sum=1,j=2; int main() { int n,m; int i; cin>>n; for (i=1;i<=n;i++) //?i???? { cin>>m; yinshu(m); //???? cout<<sum<<endl; sum=1,j=2; } return 0; } void yinshu(int mm) //????? { int k; for (k=j;k*k<=mm;k++) //???? { if (mm%k==0) { sum=sum+1; j=k; yinshu(mm/k); //??????? } } }
1
418
int f(int x,int k); int main() { int i=1,n,m; int result; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&m); result=f(m,2); printf("%d\n",result); } return 0; } int f(int x,int k) { int a=0; int i; if (x==1) return 1; for (i=k;i<=x;i++) { if (x%i==0) a=a+f(x/i,i); } return a; }
1
419
int fact(int n,int m);//????fact int main()//????? { int n,a[35000],i,b[35000]; cin>>n; for(i=0;i<n;i++)cin>>a[i];//??????????? for(i=0;i<n;i++)b[i]=fact(a[i],2);//?????????????????fact(a[i],2) for(i=0;i<n;i++)cout<<b[i]<<endl;//???????? return 0; }//????? int fact(int n,int m)//fact?? { int sum=1,i,temp=0; if(n<m)return 0;//?n<m,?????0 else if(n==2)return 1;//?n???2??????1 else { for(i=m;i<n;i++)//??????m?n {if(n%i==0)sum=sum+fact(n/i,i);}//?n??i????sum??fact(n/i,i)??,???? return sum; } }//fact??
1
420
/* * 1118-4.cpp * * Created on: 2011-11-29 * Author: Administrator */ int divide(int n,int a){ int s=0,t=0,i; if(n==1) return 1; for(i=a;i>1;i--) if(n%i==0){ s+=divide(n/i,i); t++; } if(t==0) return 0; return s; } int main(){ int n,k; cin>>k; while(k>0){ cin>>n; cout<<divide(n,n)<<endl; k--; } return 0; }
1
421
/*?? ???????a???????????????? ?a = a1 * a2 * a3 * ... * an???1 < a1 <= a2 <= a3 <= ... <= an? ????????????????a = a??????? ???? ?1?????????n?????n???????????1?????????a (1 < a < 32768) ???? n???????????????????????????????????*/ int main() { int F( int, int ); int N;cin>>N; for( int I=1; I<=N; ++I) { int A; cin>>A; cout<<F(A,2)<<endl; } return 0; } int F(int A, int CHU)//?A???CHU??????????? { int RET=1; for( int I=CHU;I<=sqrt(A);I++) { if(A%I==0)RET+=F(A/I,I); } return RET; }
1
422
void main() { int PrimeElement(int n,int m); int n,m,i,k,t; m=2; scanf("%d",&k); for(i=0;i<k;i++) { scanf("%d",&n); t=PrimeElement(n,m); printf("%d\n",t); } } int PrimeElement(int n,int m) { int i,t; t=0; for (i=m;i <=sqrt((double)(n));i++) { if (n % i == 0) t = t + PrimeElement(n / i, i); } t = t + 1; return t; }
1
423
int times=1; int used[1000]={0}; void fuck(int n) { int i=0; for (i=2;i<=sqrt(n);i++) { if (used[i]==0&&n%i==0) { int j=0; for (j=0;j<=i-1;j++) used[j]=1; times++; fuck(n/i); for (j=0;j<=i-1;j++) used[j]=0; } } } int main() { int n=0; int num=0; cin>>n; int i=0; for (i=0;i<n;i++) { cin>>num; fuck(num); cout<<times<<endl; times=1; int k=0; for (k=0;k<=999;k++) used[k]=0; } return 0; }
1
424
int fenjie(int n,int x){ int i,t=0; //t??? ??? for(i=x;i<=sqrt(n);i++){ if(n%i==0){ t=t+1+fenjie(n/i,i); //???????? ???????? } } return t; //???????????0 } int main(){ int i,t,n; cin>>t; for(i=0;i<t;i++){ //???? cin>>n; cout<< fenjie(n,2)+1<<endl;} return 0; }
1
425
const int mov[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}}; int m, n, counter; void dfs(int m, int i) { //cout << m << ' ' << n << endl; if (m == 1) { ++counter; return; } for (;i <= m; ++i) { if (m % i == 0) { dfs(m/i, i); } } } int main() { int t, m, n; cin >> t; while (t--) { counter = 0; cin >> m; dfs(m, 2); cout << counter << endl; } }
1
426
/* ????.cpp * Created on: 2012-11-21 * Author: ?? */ int ans(int a, int i) {//?????? int sum = 0;//?? for (int j = i; j <= sqrt(a); j++) {//?i???a?? if (a % j != 0) continue;//?????? sum++;//??????1 if (a >= j * j) sum += ans(a / j, j);//???????????????????? } return sum; } int main() { int n, a;//??????? cin >> n; for (int i = 0; i < n; i++) { cin >> a; cout << ans(a, 2) + 1 << endl; } return 0; }
1
427
int fj(int a,int zs){ int k,n,z; n=0;z=0; for(k=zs;k<=sqrt(a);k++){ if(a%k==0){n=n+fj(a/k,k); z=1;} } if(z==0){return 1;} else{return n+1;} } int main(){ int m,i,t; scanf("%d",&m); for(i=0;i<m;i++){ scanf("%d",&t); printf("%d\n",fj(t,2)); } return 0; }
1
428
int col(int a,int b); int main() {int n,i,m,l; scanf("%d",&n); for(i=1;i<=n;i++) {scanf("%d",&m); l=col(m,2)+1; printf("%d\n",l); } return 0; } int col(int a,int b) {int i,t,tt=0,sig=0; for(i=b;(i<a/2)&&((a/i)>=i);i++) { if(a%i==0) {t=a/i; tt=tt+1+col(t,i); sig=1; } } if(sig==0) tt=0; return(tt); }
1
429
//********************************************** //**???1090 ????************************* //**?????? 1000012741********************* //**???2010?12?7?************************* //********************************************** //??change???a???????p??????? int change (int a, int p) { int i, count = 0; //count?????????? for (i = p; i < a; i++) { if (a % i == 0 && a / i >= i) //?????????????? { count++; //???1 int k, t; k = (int) sqrt(a / i); //?k?a/i???? for (t = 2; t <= k; t++) { if ((a / i) % t == 0) //??a???2?k?????? { count += change (a / i, i); //?a/i?????? break; } } } } return count; //??count? } int main() { int n, i, a; //n?????????a????? cin >> n; for (i = 1; i <= n; i++) { int total = 0; //total????? cin >> a; total += change (a, 2); //??change?? cout << total + 1 << endl; //??1????????????? } return 0; } //**********************************************
1
430
int main() { int a[10000],b[10000],p,q,m,n,i,j; scanf("%d",&n); for(i=0;i<n;i++){ scanf("\n%d",&a[i]); } for(i=0;i<n;i++){ printf("%d\n",ans(a[i],2)); } return 0; } int ans(int sum,int min) { int w,x,u=1; for(w=min;w<sum/2;w++){ x=sum%w; if(x==0){ if(w<=sum/w) u+=ans(sum/w,w); } } return u; }
1
431
int geshu;//????? void yinshu(int num,int a)//?????? { int i;//??? if (num==1) geshu++;//?1?????? else { for(i=a;i<=num;i++) { if (num%i==0)//??????? { //cout<<"neibu???"<<i<<" "<<endl; yinshu(num/i,i);//?num/i????? } } } } int main() { int shu,j,num1[10000];//shu??????j??????num????? cin>>shu; for(j=0;j<shu;j++) { geshu=0; cin>>num1[j]; //cout<<"???"<<j<<" "; yinshu(num1[j],2);//????? cout<<geshu<<endl;//?? } cin.get();cin.get();cin.get();cin.get();cin.get(); return 0; }
1
432
int sum=0; void f(int x,int y) { if(x==1) sum++; while(y<=x) { if(x%y==0) f(x/y,y); y++; } } int main() { int n,i,a; cin>>n; for(i=1;i<=n;i++) { cin>>a; int j=2,num=1; while(j<=a/2) { if(a%j==0) { sum=0; f(a/j,j); num+=sum; } j++; } printf("\n%d",num); } return 0; }
1
433
/* * seperateThenumber.cpp * * Created on: 2012-11-13 * Author: AK */ int sum=1; //??????sum ??f???sum????? void f(int begin,int m){ //??f?? int i; for(i=begin;i<=m;i++){ //?i??????????? if(m%i==0&&m/i>=i){sum++;f(i,m/i);} //????????????????? ???????????? if(i>m/i) break; //?????????????break } } int main(){ int n,j,m; cin>>n; //????????n for(j=1;j<=n;j++){ //??????? cin>>m; f(2,m); cout<<sum<<endl; //??sum? sum=1; //??sum=1 } return 0; }
1
434
//1000012915??? int f(int a,int min); int main() { int n,i,a,A[100]; //???? cin>>n; for(i = 0;i < n;i++) //?? { cin>>a; A[i]=f(a,2); //?2????? }; for(i = 0;i < n;i++)cout<<A[i]<<endl; //?? return 0; } int f(int a,int min) { int result = 1; int i; if(a < min) //?min?a?????????a???????? { return 0; } for(i = min;i<a;i++) //???????????????n??? { if(a % i == 0) { result += f(a/i,i); //????????????????????????x??? } } return result; }
1
435
void main() { int f(int m,int i); int n,a,b,i; scanf("%d",&n); for(i=1;i<=n;i++) {scanf("%d",&a); b=f(a,2); printf("%d\n",b);} } int f(int m,int i) { int s,j; if(m<i) s=0; else {if(m<i*i) s=1; else {for(s=1,j=i;j<=m;j++) {if(m%j==0) s=s+f(m/j,j); } } } return(s); }
1
436
int kind (int k,int a) { int i,j,temp=0; int x; for (i=a;i<k;i++) { if (i<=k/i&&k%i==0) { x=k/i; // printf("%d*%d=%d\n",x,i,k); temp++; for (j=i;j<x;j++) { if (j<=x/j&&x%j==0) { temp=temp+kind(x,j); break; } } } } return (temp); } int main () { int n,i,s,a[32768][2]; scanf("%d",&n) ; for (i=0;i<n;i++) { scanf("%d",&a[i][0]); a[i][1]=kind(a[i][0],2); } for (i=0;i<n;i++) { printf("%d\n",a[i][1]+1);//k=k???? } //scanf("%d",&n) ; return 0; }
1
437
int num(int a,int b); int main() { int t; int a; cin>>t; for(int i=1;i<=t;i++) //?? { cin>>a; //???? cout<<(num(a,2))<<endl; //???? } return 0; } int num(int a,int b) { int f=0; if(a>=b) //???????????? { for(int i=b;i<=a;i++) //???? { if(a==i) f++; else if(a%i==0) f=f+num(a/i,i); //??????????? } } return f; }
1
438
//------------------ // 1057??? // 2010/12/1 // ??? //------------------ int devide(int m,int x,int i) { if(x==1&&m>=i) return 1; else if(x>1) { int j=i; int sum=0; while(j<=m) { if(j!=1&&m%j==0) sum=sum+devide(m/j,x-1,j); j++; } return sum; } return 0; } int main() { int n,a,i; cin>>n; for(i=0;i<n;i++) { int sum=0; cin>>a; for(int X=1;X<=16;X++) sum+=devide(a,X,1); cout<<sum<<endl; } return 0; }
1
439
int f(int num,int i) { int sum; sum=0; int j; for(j=i;j<=num/2;j++) { if(num%j==0) { if(num/j<j) { sum=sum; }else{ sum=1+sum+f(num/j,j); } } } return sum; } int main() { int n,num,i; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&num); int j,sum; sum=0; j=2; sum+=f(num,j); printf("%d\n",sum+1); } return 0; }
1
440
//////////////////////// //??????? // //?????? // //???1200012823 // //???2012?11?25?// //???????? // //////////////////////// int totalCount; // ????????? void FindFact(int x, int max) // ??????max????????????? { if (x == 1) // ?????? { totalCount++; return; } for (int i = max; i > 1; i--) // ?max???????? if (x % i == 0) // ???? FindFact(x / i, i); // ????????? return; } int main() { int n, x; for (cin >> n; n > 0; n--) // ????????? { totalCount = 0; cin >> x; FindFact(x, x / 2); // ?x/2????????? cout << totalCount + 1 << endl; // ????? } return 0; }
1
441
int yz[100],all=0; int yinzi(int num,int amax) { int i,j=0,geshu=0,key=num; if(num==1) return 1; else { for (i=amax;i<all;i++) { if(num%yz[i]==0) { num=num/yz[i]; geshu=geshu+yinzi(num,i); num=key; } } return geshu; } return 0; } int main () { int num,n,i,c,j=0,k; cin>>n; for(k=0;k<n;k++) { cin>>num; if(num==1) cout<<1<<endl; else { j=0; for (i=2;i<=num;i++) { if(num%i==0) { yz[j]=i; j++; } } all=j; cout<<yinzi(num,0)<<endl; } } return 0; }
1
442
int f(int a, int b) { int k = 0; if (a >= 2 * b) { for (int i = b; i <= a / b; i++) { if (a % i == 0 && a/i >= i) { k += f(a/i, i) + 1; } } } else { k = 0; } return k; } int main() { int n, a, t; cin >> n; while (n--) { cin >> a; t = f(a, 2) + 1; cout << t << endl; } return 0; }
1
443
int chu(int i,int n); int main() { int n,m,i,j; int sum[100]; scanf("%d",&n); for(i=0;i<=(n-1);i++) { scanf("%d",&m); sum[i]=0; for(j=2;j<=sqrt(m);j++) { if(m%j==0) { sum[i]+=chu(j,m/j); } } } for(i=0;i<=(n-1);i++) { printf("%d\n",sum[i]+1); } } int chu(int i,int n) { int j,m,t; t=1; m=n; for(j=i;j<=sqrt(m);j++) { if(m%j==0) { t+=chu(j,(m/j)); } } return t; }
1
444
/* * ????factorization.cpp * ?????? * ????:2012-11-26 * ??????? */ int j=2; //??????j int kinds(int x){ //????kinds int sum=1; if(x==1)return 0; //?????????1????1?????????0 for(int i=j;i<=sqrt(x);i++) //?for????x????????1??i?? if(x%i==0) //??x???i?????????i?????????? { sum+=kinds(x/i); //??????x/i???? j=i+1; //??????i????????x???? } return sum; //??????????? } int main(){ //??? int n=0; cin>>n; //?????????n for(int i=0;i<n;i++) { int x=0; //????x cin>>x; //??x cout<<kinds(x)<<endl; //??x????????kinds j=2; //?? } return 0; //????? }
1
445
int dfs(int k, int b) { int ret=(k==1),i; for (i=b;i<=k;i++) if (k%i==0) ret+=dfs(k/i,i); return ret; } int main() { int n, k; cin>>n; for (int i=1;i<=n;i++) { cin>>k; cout<<dfs(k,2)<<endl; } return 0; }
1
446
int t; void calc(int a,int d) { int i; if (a==1) t++; else{ if (a>=d) for (i=d;i<=a;i++) if (a%i==0) calc(a/i,i);} } void main() { int n,i,a; scanf("%d",&n); for (i=1;i<=n;i++) { scanf("%d",&a); t=0; calc(a,2); printf("%d\n",t); } }
1
447
int w=1; int f(int x) { int z=1,y,v=0; for(y=w+1;y<=sqrt(x);y++) { if(x%y==0) { z=z+f(x/y); v++; w=y; } } if(v==0) z=1; return z; } main() { int n,u=0,a; scanf("%d",&n); do { scanf("%d",&a); printf("%d\n",f(a)); u++; w=1; } while(u!=n); }
1
448
int fac(int p, int q) { int i, t = 1; if (p > q) { return 0; } if (p == q) { return 1; } for (i = p; i <= sqrt(q); i++) { if (q % i == 0) { t += fac(i, q / i); } } return t; } int main() { int a, i, n; cin >> n; for (i = 0; i < n; i++) { cin >> a; cout << fac(2, a) << endl; } return 0; }
1
449
int yinshu(int num,int min); int main(){ int n,i; scanf("%d",&n); for(i=0;i<n;i++){ int a,result; scanf("%d",&a); result=yinshu(a,2)+1; printf("%d\n",result); } return 0; } int yinshu(int num,int min){ int r,x=0; if(num<min){ return 0; } else{ for(r=min;r*r<=num;r++){ if(num%r==0){ x=x+1+yinshu(num/r,r); } } return x; }}
1
450
int f(int a,int j); int main() { int n,a,s,i; cin>>n; for(i=0;i<n;i++) { cin>>a; s=f(a,2)+1; cout<<s<<endl;} return 0; } int f(int a,int j) { int i,tem; //if(j>sqrt(a))return 0; int count = 0; for(i=j;i<=sqrt(a);i++) { if(a%i==0) { j=i; //tem=f(a/i,j); //count=(tem+1)+count; //cout<<"i="<<i<<","<<"f="<<tem<<","<<count<<endl; //cout<<"count="<<count<<endl; //count=(f(a/i,j)+1)+count; //count=count+(f(a/i,j)+1); if(a/i < j) count+=1; else count+=(f(a/i,j)+1); //cout<<"i="<<i<<","<<count<<endl; } } return count; }
1
451
int fenjie(int a,int b) { int i,sign=0,k=0; if(a<b) return 0; else if(a==b) return 1; else { for(i=2;i<=a-1;i++) { if(a%i==0) sign=1; } if(sign!=1) return 1; else { for(i=b;i<=a;i++) { if(a%i==0) k+=fenjie(a/i,i); } k+=1; return k; } } } int main() { int n,a[100],i,k; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&k); printf("%d\n",fenjie(k,2)); } return 0; }
1
452
int a[1000]; int l=0,x; int fff(int k,int w,int t,int x); int main() { int i,j,q,p,n,m,y; scanf("%d",&n); for(p=0;p<n;p++) {q=1;l=0; scanf("%d",&x); for(i=2;i<=x;i++) if(x%i==0) {a[q]=i; q++; } fff(1,q-1,1,x); printf("%d\n",l,x); } } int fff(int k,int w,int t,int x) { int i,j,y,n,m,p; for(i=t;i<=w;i++) {if(x%a[i]==0) { x=x/a[i]; if(x==1){l++;} if(x>1) fff(k+1,w,i,x); x=x*a[i]; } } }
1
453
int b[40000]={0}; void zhishu(int n) { int i,j; for(i=2;i<sqrt(n);i++) { for (j=2;j<n/i+1;j++) { b[i*j]=1; } } } int fenjie(int n,int m) { int s=0,i; if (n<m) return 0; if (n==m||b[n]==0) return 1; for (i=m;i<n;i++) { if (n%i==0) { s=s+fenjie(n/i,i); } } return s+1; } int main() { int n,i,max=0,a[1000]; cin>>n; for (i=0;i<n;i++) { cin>>a[i]; if (a[i]>max) max=a[i]; } zhishu(max); for (i=0;i<n;i++) cout<<fenjie(a[i],2)<<endl; return 0; }
1
454
/* * fenjie.cpp * * Created on: 2013-11-24 * Author: ?? */ int num=0; void fj(int m,int i){ if(m==1)num++; else { for (int j=i;j<=m;j++){ if(m%j==0)fj(m/j,j); } } } int main(){ int n,m;cin>>n; for(int ii=0;ii<n;ii++){ cin>>m;fj(m,2); cout<<num<<endl; num=0; } return 0; }
1
455
int m=0; int main() { void count(int a,int b); int r,i,k,n; scanf("%d",&r); for(i=0;i<r;i++) { scanf("%d",&n); for(k=2;k<=sqrt(n);k++) { if(n%k==0) { m++; count(k,n/k); } } printf("%d\n",m+1); m=0; } } void count(int a,int b) { int j; double t=sqrt(b); for(j=a;j<=t;j++) { if(b%j==0) { m++; count(j,b/j); } } }
1
456
int n; int next(int a,int b) { if(a==1) return 1; if(a<b) return 0; int sum=0; for(;b<=a;b=b+1) if(a%b==0) sum=sum+next(a/b,b); return sum; } int main() { int i,m; cin>>m; for(i=0;i<m;i=i+1) { cin>>n; cout<<next(n,2)<<endl; } return 0; }
1
457
int f(int a,int c); int j,b; int main() { int i,n,m; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&m); printf("%d\n",f(m,2)); } return 0; } int f(int a,int c) { int j,b=0; for(j=c;j<=sqrt(a);j++) { if(a%j==0) { b=b+f(a/j,j); } } return b+1; }
1
458
int number=0; int l; void sort (int n) { int i; for (i=l;n/i>=i;i++) { if (n%i==0) { l=i; sort (n/i); if (n/i==1) number++; } } number++; } int main () { int n,m,k; cin >> n; for (k=0;k<n;k++) { l=2; number=0; cin >> m; sort (m); cout << number << endl; } return 0; }
1
459
//******************************************************* //*?????????.cpp * //*?????? * //*?????2010?12?9? * //*??????????????? * //*?????????????????????????? * // ??????????????????????? * //******************************************************* int a=2;//???????????? int result =0;//????????????? void function(int,int); int main() { int n=0; int data=0; int i=0; cin>>n; for(i=1;i<=n;i++) { cin>>data; function(data,a); cout<<result<<endl; result=0;//?? } return 0; } void function(int x,int y) { int j=0; if(x==1)//??????1 ???????????? { result=result+1; } for(j=y;j<=x;j++)//??1 { if(x%j==0)//???????? { function(x/j,j); } } }
1
460
int f(int a,int min) { if(a<min) { return 0; } int k=1,i; for(i=min;i<a;i++) { if(a%i==0) { k=k+f(a/i,i); } } return(k); } int main() { int f(int a,int min); int j,n; int a[100],b[100]; scanf("%d",&n); for(j=0;j<n;j++) scanf("%d",&a[j]); for(j=0;j<n;j++) { b[j]=f(a[j],2); printf("%d\n",b[j]); } return 0; }
1
461
//n???????i????????? int divi(int n,int i) { int num=0; if(n%i==0) { if(n==i) //?????????????????1 { return 1; } for(int j=2;j<=i;j++) { num=num+divi(n/i,j); //?? } return num; } else { return 0; } } int main() { int n=0; //????? int t=0; //???? int sum; //????? cin>>t; for(int i=0;i<t;i++) { sum=0; cin>>n; for(int j=2;j<=n/2;j++) //?????????1*n??? { sum=sum+divi(n,j); } cout<<sum+1<<endl; } return 0; }
1
462
int divide(int a,int b) { int i,r; r=1; for(i=b;i<a;i++) { if(((a/i)*i)==a&&(a/i)>=i) r=r+divide(a/i,i); } return r; } int main() { int s,p,n,j; scanf("%d",&n); for(j=0;j<n;j++) { scanf("%d",&p); s=divide(p,2); printf("%d\n",s); } }
1
463
/* * part.cpp * * Created on: 2012-11-25 * Author: Lsj */ int disintegerate(int a, int b)//?????a???? { if (a == b || b == 1)//a b????b=1?????? return 1; if (a > b)//a??b?b???1????0???0 return 0; int ans = 0;//ans??? for (int i = a; i <= b; i++)//?a?b?? { if (b % i == 0)//b?????? ans = ans + disintegerate(i, b / i);//?????? } return ans;//??ans } int main()//main?? { int Time; cin >> Time;//???? while (Time > 0) { int n; cin >> n;//??n cout << disintegerate(2, n) << endl;//???? Time--;//Time?1 } return 0; }//??
1
464
int N, A; int acSearch(int n, int i) { int ret = 0; if(n == 1) ret = 1; else for(; i <= n; ++ i) if(n%i == 0) ret += acSearch(n/i, i); return ret; } int main() { scanf("%d", &N); for(; N --;) { scanf("%d", &A); printf("%d\n", acSearch(A, 2)); } return 0; }
1
465
int temp=2,sum=0; void dg(int x) { for(int i=temp; i<=x; i++) { if(x%i==0) { temp=i; if(x/i==1) { sum++; temp=2; } else dg(x/i); } } } int main() { int n; cin>>n; int x; for(int i=0;i<n;i++) { cin>>x; dg(x); cout<<sum<<endl; sum=0; } return 0; }
1
466
void find(int m,int j,int *p) { for(;j<=m;j++) { if(m==j) { (*p)++; break; } if(m%j==0) find(m/j,j,p); } } int main() { int n,m,i,j; scanf("%d",&n); for(i=0;i<n;i++) { int count=0; int *p; p=&count; scanf("%d",&m); find(m,2,p); printf("%d\n",count); } return 0; }
1
467
/*???????a?????????????????a = a1 * a2 * a3 * ... * an???1 < a1 <= a2 <= a3 <= ... <= an?????????????????a = a??????? ???? ?1?????????n?????n???????????1?????????a (1 < a < 32768) ???? n??????????????????????????????????? ???? 2 2 20 ???? 1 4*/ int ct; int count(int n, int p) { int i; if(n==1) ct++; for(i=p;i<=n;i++) if(n%i==0) count(n/i,i); } int main() { int n,m,i; cin>>m; for(i=1;i<=m;i++) { ct=0; cin>>n; count(n,2); cout<<ct<<endl; } }
1
468
int f(int,int); int main() { int N; cin>>N; int i; for(i=1;i<=N;i++) { int a; cin>>a; cout<<f(a,2)<<endl; } return 0; } int f(int n,int m) { int j; int number=1; for(j=m;j<=(int)sqrt(n);j++) { if(n%j==0) { number=number+f(n/j,j); } } return number; }
1
469
int fenjie(int a,int b) { int c=1,i; for(i=b;i<=(int)sqrt(a);i++) { if(a%i==0) c+=fenjie(a/i,i); } return c; } main() { int n,i,a,c; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&a); c=fenjie(a,2); printf("%d\n",c); } }
1
470
int numcheck(int num,int a)//???????num??????????a?????? { int i=0,sum=0; if(num==1)//??1???????? return 1; else if(num<a) return 0; else { for(i=a;i<=num;i++)//????????????????? { if(num%i==0) sum=sum+numcheck(num/i,i); } } return sum; } int main() { int n=0,i=0,num=0,sum=0; cin>>n; for(i=1;i<=n;i++) { cin>>num; sum=numcheck(num,2); cout<<sum<<endl; } return 0; }
1
471
struct node { int s,n; }; void cpy_clr(struct node a[],struct node b[]) { int i; for(i=0;i<=MAX&&(a[i].s!=0||b[i].s!=0);i++) if(b[i].s!=0) {a[i].s=b[i].s;a[i].n=b[i].n;b[i].s=0;b[i].n=0;} else {a[i].s=0;a[i].n=0;b[i].n=0;} } int chklst(struct node a[],int n) { int i; int result=0; for(i=0;a[i].s!=0;i++) { if(a[i].s!=n){result=0;break;} else result++; } return result; } void init(struct node a[]) { int i; for(i=0;i<MAX;i++) {a[i].s=0;a[i].n=0;} } void main() { struct node a[MAX],b[MAX]; int i,j,k,l,_n,n,sum=0; scanf("%d",&n); while(n--) { scanf("%d",&_n); for(l=2;l<_n;l++) if(_n%l==0) { init(a);init(b); a[0].s=l;a[0].n=l; while(chklst(a,_n)==0&&a[0].s!=0) { i=0;k=-1; if(a[0].s==0) break; while(a[i].s!=0) { if(a[i].s==_n) sum++; else { for(j=a[i].n;j<=(_n/a[i].s);j++) if(_n%(a[i].s*j)==0) {b[++k].s=a[i].s*j;b[k].n=j;} } i++; } cpy_clr(a,b); } i=0; while(a[i].s!=0) { if(a[i].s==_n) sum++; i++; } } printf("%d\n",++sum); sum=0; } }
1
472
int sum=0; void f(int n,int y) { int a=sqrt(n); for(int i=y;i<=a;i++) { if(n%i==0) { sum++; y=i; f(n/i,y); } } } int main() { int n; cin>>n; for(int i=1;i<=n;i++) { int num; cin>>num; sum=0; f(num,2); cout<<sum+1<<endl; } return 0; }
1
473
//********************** //* ??? ???? * //* 1200012878 ??? * //* 12?1? * //********************** int fengjie(int a, int b) { if (a ==2 || a == 3) return 1; int sum = 1; int c = sqrt(a); for (int i = b; i <= c; i++) { if (a % i == 0) { sum = sum + fengjie(a / i, i); } } return sum; } int main() { int n, a; cin >> n; for (int i = 1; i <= n; i++) { cin >> a; cout << fengjie(a, 2) << endl; } return 0; }
1
474
int num=1,k=0; int count(int n) { for(int i=2;i<=sqrt(n);i++) { if(n%i==0&&i>=k) { num++; k=i; count(n/i); k=0; } } return (num); } int main() { int i,n,a[100]; cin>>n; for(i=0;i<n;i++) { cin>>a[i]; } for(i=0;i<n;i++) {cout<<count(a[i])<<endl;num=1;k=0;} return 0; }
1
475
int factor(int N,int min) { int result=1,i; if(N<min) { return 0; } for(i=min;i<N;i++) { if(N%i==0) { result+=factor(N/i,i); } } return result; } main() { int n=0,i=0,x=0,y=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&x); y=factor(x,2); printf("%d\n",y); } return 0; }
1
476
int f2(int i,int a) { int c,s=0; for(i;i<=a/2;i++) { if(a%i==0) { c=a/i; if(c>=i) { s=s+f2(i,c); } } } s=s+1; return s; } int f(int a) { int s=0; s=s+f2(2,a); return s; } int main() { int n,i,a,b; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a); b=f(a); printf("%d\n",b); } return 0; }
1
477
int fenjie(int x,int p); int N; int main() { int n,i; scanf("%d",&n); for(i=0;i<n;i++) {scanf("%d",&N); printf("%d\n",fenjie(N,2)); } return 0; } int fenjie(int x,int p) { int f=0; if(x==1) return 1; else {for(int i=p;i<=x;i++) if(x%i==0) f=f+fenjie(x/i,i); } return f; }
1
478
/* * ???? .cpp * * Created on: 2012-11-27 * Author:?? * ???????a?????????????????a = a1 * a2 * a3 * ... * an? * ??1 < a1 <= a2 <= a3 <= ... <= an?????????????????a = a??????? */ int answer = 0;//??????? void f(int n, int N) { if (n < N) N = n;//???????????? if (N == 1) { answer++;//?????? return; } while (N > 1) { if (n % N == 0) f(n / N, N);//?????,????? N--;//?????? } } int main() { int n , a ; cin >> n ; //????n for ( int i = 0 ; i < n ; i++ ) { cin >> a ; f( a , a ) ; //???? cout << answer << endl ; answer = 0 ; //???? } return 0 ; }
1
479
int total,p; void part(int y){ int i2,up; if (y==1) return; up=(int)sqrt(y); for (i2=2;i2<=up;i2++){ if (p<=i2){ if (y%i2==0){ total++; p=i2; part(y/i2); p=0; } } } } int main(){ int n,i,a; scanf("%d",&n); for (i=1;i<=n;i++){ total=0; p=0; scanf("%d",&a); part(a); printf("%d\n",total+1); } return 0; }
1
480
int factoring(int a,int b) { int i,kind=0; //printf("ok a=%d b=%d\n",a,b); if(a==1) { kind=1; //printf("kind=1 ok\n"); } else { for(i=b;i<=a;i++) { // printf("ok\n"); if(a%i==0) { kind=factoring(a/i,i)+kind; //printf("ok %d\n",kind); } } } return kind; } int main() { int n,x[40000],i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&x[i]); } for(i=0;i<n;i++) { x[i]=factoring(x[i],2); printf("%d\n",x[i]); } return 0; }
1
481
int function(int a, int m) { int sum=1,i; if(a>m) return 0; else { for(i=a;i<m;i++) { if(m%i==0) sum=sum+function(i,m/i); else continue; } return sum; } } void main() { int n,i,m[100]; scanf("%d",&n); for(i=0;i<=n-1;i++) { scanf("%d",&m[i]); } for(i=0;i<=n-1;i++) { printf("%d\n",function(2,m[i])); } }
1
482
int varieties=0;//???????varieties??????? void factor(int,int);//????? int main()//??? { int n=0,num=0,i=0;//???? cin>>n; for(i=1;i<=n;i++)//????????????? { varieties=0; cin>>num; factor(2,num);//???? cout<<varieties<<endl; } return 0; } void factor(int first,int num)//??factor???????????? { int i=0; if(num==1)//???? { varieties++; } else { for(i=first;i<=num;i++)//??????1<a1<=a2<=...<=an??? { if(num%i==0) { factor(i,num/i); } } } }
1
483
int factor(int n,int min){ int result=1,i; if(n<min){ return 0;} for(i=min;i<n;i++){ if(n%i==0){ result=result+factor(n/i,i); } } return result; } int main(){ int n,a[100000],b[100000]; scanf("%d",&n); for(int j=0;j<=n-1;j++){ scanf("%d",&a[j]); b[j]=factor(a[j],2); printf("%d\n",b[j]); } return 0;}
1
484
/* * hanshu_huisu_1.cpp * Name????? * Created on: 2010-12-7 * Author: ?? */ int n,c; int solutionnumber(int n,int c){//n?????,c??? if(n==c) return 1;//?n=c???????????????????????1 if(n<c) return 0;//??n<c?????????0 if(n%c==0) return solutionnumber(n/c,c)+solutionnumber(n,c+1);/*?n??c??????? ???c????????????n???c???????*/ else return solutionnumber(n,c+1); } int main(){ int N,a; cin>>N;//????????? while(N>0){ cin>>a;//?????? cout<<solutionnumber(a,2)<<endl;//????????? N--; } return 0; }
1
485
int a[40000]={0}; void fun(int n,int j,int k){ int i; for(i=j;i<=sqrt(n);i++){ if(n%i==0){ j=i; a[k]++; fun(n/i,j,k); } } } int main() { int n; int m[40000]={0}; int i; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",&m[i]);} for(i=1;i<=n;i++){fun(m[i],2,i);} for(i=1;i<=n;i++){ printf("%d\n",a[i]+1);} return 0; }
1
486
int factor(int a,int b){ int i,ways; ways=1; if(a<b) return 0; for(i=b;i<=sqrt(a);i++){ if(a%i==0) ways+=factor(a/i,i); } return ways; } int main(){ int n,A[99],K[99],i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]); K[i]=factor(A[i],2); } for(i=0;i<n;i++){ printf("%d\n",K[i]); } return 0; }
1
487
int sushu(int a) { int b=2,c,d=0,k; while (b<a) { c=a%b; if (c!=0) { b=b+1; d=d+1;} else break; } if(d==(a-2)) k=1; else k=0; return k; } int zheng(int n,int i) { int sum=1,a; for(a=i;a<n/2;a++) { if(n%a==0) { if(a<=n/a) { sum=sum+zheng(n/a,a); } } } return sum; } int main () { int n,i,j=0,k=0,b[10000]={0},e[40000]={0}; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&e[i]); } for(i=0;i<n;i++) { if(sushu(e[i])==0) { b[i]=zheng(e[i],2); } else { b[i]=1; } } printf("%d",b[0]); for(i=1;i<n;i++) printf("\n%d",b[i]); return 0; }
1
488
int t(int, int); int s, j, k1; int main() { int a, n, i; cin >> n; for (i = 1; i <= n; i++) { cin >> a; s = 1; k1 = 0; for (j = 2; j <= sqrt((double) a); j++) { if (a % j == 0) t(a / j, j); } cout << s << endl; } return 0; } int t(int a, int b) { int k; for (k = b; k <= a; k++) { if (a % k == 0) { if (a / k == 1) { s = s + 1; break; } t(a / k, k); } } return 0; }
1
489
int num = 1, i, factor; void f(int factor, int x) { for (; factor * factor <= x; factor++) { if (x % factor == 0) { num++; f(factor, x / factor); } } } int main() { int a, n; cin >> n; while(n--) { cin >> a; f(2, a); cout << num << endl; num = 1; } return 0; }
1
490
/* * ways.cpp * * Created on: 2013-11-24 * Author: Mac */ int factor(int a, int f) { if(a == f) return 1; if (a < f) return 0; if(a%f == 0) return factor(a, f+1) + factor(a/f, f); else return factor(a, f+1); } int main() { int x, a; cin >> x; while(x > 0) { cin >> a; cout << factor(a, 2) << endl; x --; } }
1
491
int factor(int,int); int main() { int n,num; cin>>n; for(int i=0;i<n;i++) { cin>>num; cout<<factor(num,2)<<endl; } return 0; } int factor(int n,int min) { int i; int num=1; if(n<min) return 0; else { for(i=min;i<n;i++) { if(n%i==0) num+=factor(n/i,i); } } return num; }
1
492
int fenjie(int x,int k) { int t=1,i; if(k>x) { return 0; } for(i=k;i<x;i++) { if(x%i==0) { t=t+fenjie(x/i,i); } } return t; } int main() { int j,p,n,a[101]; scanf("%d",&n); for(j=0;j<=n-1;j++) { scanf("%d",&a[j]); } for(j=0;j<=n-1;j++) { printf("%d",fenjie(a[j],2)); printf("\n"); } return 0; }
1
493
int fenjie(int x,int y){//x????? y?????????? int i,s=0;//s?????? if(x==y)return 1; for(i=y;i<x;i++) if(x%i==0)s+=fenjie(x/i,i); if(i==x)s++; return s; } int main(){ int n,i;//n??????? cin>>n; for(;n>0;n--){ cin>>i; cout<<fenjie(i,2)<<endl; } return 0; }
1
494
int reek(int i,int j) { int k,g=0; for (k=j;k<i;k++) { if ((i%k==0)&&(k!=1)) { g=1; break; } else continue; } if (g==0) return 1; else { int num=1; for(k=j;k<=sqrt(i);k++) { if ((i%k==0)&&(k!=1)) num+=reek(i/k,k); else continue; } return num; } } int main() { int n,i,a[1000]; cin>>n; for(i=0;i<n;i++) { cin>>a[n]; cout<<reek(a[n],1)<<endl; } return 0; }
1
495
//****************************************************************************** //??? ?????????????? * //????wayne * //?????11.23 * //****************************************************************************** int sum=1,j=2; //????????????????? void num(int); //?????? int main() //????? { int n,a[100]; int i; cin>>n; for (i=1;i<=n;i++) //????n????? { cin>>a[i]; num(a[i]); //???? cout<<sum<<endl; sum=1,j=2; //???????????????? } return 0; } void num(int a) //???? { int k; for (k=j;k<=sqrt(a);k++) //k=j????????????????? { if (a%k==0) //??????? { sum=sum+1; //????? j=k; //??????? num(a/k); //???? } } }
1
496
int c; void cal(int n,int k); int main(int argc) { int m,n,j; cin>>m; for (j=1;j<=m;j++) { cin>>n; c=0; cal(n,1); cout<<c<<endl;} return 0; } void cal(int n,int k) { if (n==1) {c++; return;} int i; for (i=2;i<=n;i++) { if (n%i==0&&i>=k) {cal(n/i,i);}} }
1
497
int fenjie(int x ,int b) { int i,z=0,c; for(i=b;i<=x;i++) { if(x==i) z=z+1; else if(x%i==0) { c=x/i; z=z+fenjie(c,i); } } return(z); } void main() { int n,i,num,a; scanf("%d\n",&n); for(i=0;i<n;i++) { scanf("%d",&a); num=fenjie(a,2); printf("%d\n",num); } }
1
498
int fenjieyinshi(int n,int m)//???????? { int i=0; int sum=1; if(n<m) return 0;//??????????????????0 else { for(i=m;i<n;i++) if(n%i==0)//???????????????? sum+=fenjieyinshi(n/i,i);//?? return sum; } } int main()//??? {//????? int n=0; int i=0; int a=0; cin>>n;//??????????????? for(i=0;i<n;i++) { cin>>a;//??????? if(a==1) cout<<1<<endl; else cout<<fenjieyinshi(a,2)<<endl;//???? } return 0; }//?????
1
499
int f(int c,int t); void main() { int n,c; scanf("%d",&n); for(;n>0;n--) { scanf("%d",&c); if(c==1 || c==2) printf("1\n"); else printf("%d\n",f(c,2)); } } int f(int c,int t) { int count=1,i; for(i=t;i<c;i++) { if(c%i==0) count+=f(c/i,i); } if(i==c) return count; else return 0; }
1