id
int32 0
32.5k
| code
stringlengths 95
8.4k
| label
stringclasses 65
values |
---|---|---|
100 | int f(int x,int y);// ??????x????????y?????????????????
int main()
{
int n,i,j,a,sum;
cin>>n;
for(i=1;i<=n;i++)//??
{
cin>>a;
sum=0; //???
for(j=1;j<=a;j++)
sum+=f(a,j); //??
cout<<sum<<endl; //??
}
return 0;
}
int f(int x,int y)//???
{
int i,num=0;
if(y==1)
return 0;
else
{
if(x%y!=0)
return 0;
else if(x==y)
return 1;
else
{
for(i=y;i>=1;i--)
num+=f(x/y,i); //??
return num;
}
}
}
/*
????????????
?100??
sum=????
f(100,100)=1 ??100=100
f(100,99) =0
f(100,98)=0
....
....
f(100,50)=f(2,50)+f(2,49)+........+f(2,2)+f(2,1) =1 ?????50????f(2,2)?1,??????
....
....
f(100,2) = f(50,2)+f(50,1)=f(25,2)+0=0
f(100,1) =0
????? ??????????????
*/ | 1 |
101 | int sum=0;
int main()
{ void shu(int a,int b);
int n=0,i=0,a=0,c=0,j=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{ scanf("%d",&a);
for(j=2;j<=sqrt((double)a);j++)
{ if(a%j==0)
{ sum=sum+1;
shu(j,a/j);
}
}
printf("%d",sum+1);
if(i<n)
printf("\n");
sum=0;
}
return(0);
}
void shu(int a,int b)
{ int i=0;
for(i=a;i<=sqrt((double)b);i++)
{ if(b%i==0)
{ sum=sum+1;
shu(i,b/i);
}
}
} | 1 |
102 | int dividemin(int a,int minyinzi){
int num=0;
if(a==1)num++;
else for(int i=minyinzi;i<=a;i++)
{
if(a%i==0)num=num+dividemin(a/i,i);
}
return num;
}
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<=n-1;i++)
cin>>a[i];
for(int i=0;i<=n-1;i++)
//cout<<divide(a[i],a[i])<<endl;
cout<<dividemin(a[i],2)<<endl;
} | 1 |
103 | int t, a, flag, a1;
/*bool prime(int k)
{
int j, sqrt_k;
if (k == 2)
return 1;
else
{
sqrt_k = sqrt((double)k);
for (j = 2; j <= sqrt_k; j++)
{
if (k % (int)j == 0)
break;
}
if (j == sqrt_k + 1)
return 1;
else
return 0;
}
}
/*
void find(int m)
{
int i;
if (prime(m))
{
flag = 1;
t++;
// cout << t << endl;
return;
}
for (i = 2; i <= sqrt((double) m); i++)
{
if ((m % i == 0) && (a1 <= i))
{
// cout << a1 << 2<< endl;
//cout << i << " " << 1 <<endl;
a1 = i;
//if (!prime(m / i))
t++;
// cout << t << endl;
find(m / i);
}
}
return;
}*/
void find(int m, int min)
{
int i;
//int a[];
for (i = 2; i <= sqrt((double)m); i++)
{
if (m % i == 0)
{
if (i >= min)
//if (a1 >= i)
{
t++;
// if (!/*((m / i > i) && */(prime(m / i)))
// cout << t << " ";
// cout <<i<<" " << m / i << " " << t <<endl;
// t++;
// cout << " " << a1 <<endl;
//cout << t<<endl;
// a1 = i;
min = i;
//cout << min << endl;
find(m / i, min);
}
}
}
/*if (i == (int)sqrt((double)m) - 1)
return;*/
return;
}
int main()
{
int n, ii;
cin >> n;
for (ii = 1; ii <= n; ii++)
{
t = 0;
flag = 0;
cin >> a;
// if (prime(a)) t--;
a1 = a;
find(a, 2);
cout << t + 1<< endl;
}
return 0;
} | 1 |
104 | /*
* 35_1.cpp
*????????????
* Created on: 2010-12-3
* Author: 1000012877
*/
int n,sum;//?????n??????????sum????????
int fenjie(int min,int max)//??????????????????????????min???max?????
{ int i;//????????????????
for (i=min;i<=sqrt(max);i++){//i ?????????????
if (max%i==0&&i<=max/i){
sum++;//?????????i??????1
fenjie(i,max/i);}//???????????max??????????
if(i>max/i) break;}
return sum;
}
int main() {
int i,k;
cin>>k;//k?????????
for (i=0;i<k;i++) {
cin>>n;
sum=1;//??????????1
sum=fenjie(2,n);//?????????
cout<<sum<<endl; }
return 0; }
| 1 |
105 | int t;
void tot(int,int);
int main()
{
int n,a[100],i;
cin>>n;
for(i=1;i<=n;i++)
cin>>a[i];
for(i=1;i<=n;i++) {
t = 0;
tot(a[i],2);
cout<<t<<endl;
}
return 0;
}
void tot(int x, int min)
{ int k;
if(x==1) {
++t;
return;
}
for(k=min;k<=x;k++)
if(x%k==0)
{
tot(x/k, k);
}
} | 1 |
106 | void TRY(int,int);
int num=1;
int main()
{
unsigned short int n;
int INTEGER;
cin>>n;
while(n-->0)
{
cin>>INTEGER;
int h=2;
TRY(h,INTEGER);
cout<<num<<endl;
num=1;
}
}
void TRY(int a,int b)
{
int i;
for(i=a;i<=sqrt(b);i++)
{
if((b%i==0)&&(b/i!=1))
{
num++;
TRY(i,b/i);
}
}
} | 1 |
107 | int num=0;
int sum(int a,int i)
{
if(a==1)
{
num++;
}
else
{
while(i<=a)
{
if(a%i==0)
{
sum(a/i,i);
}
i++;
}
}
return num;
}
int main()
{
int a,t,j,i,count;
cin>>t;
for(j=0;j<t;j++)
{
count=1;
cin>>a;
i=2;
while(i<=(a/2))
{
if(a%i==0)
{
num=0;
sum(a/i,i);
count=count+num;
}
i++;
}
cout<<count<<endl;
}
return 0;
}
| 1 |
108 | /*
* 1090 ????.cpp
*
* Created on: 2010-11-26
* Author: ???
*/
int f(int a,int min) //???a???????min??????
{
int j,num; //j????num????
if (a<min) return 0; //??a??min?????????????
num=1; //???????
for (j=min;j<a;j++) //????????
if (a%j==0) num=num+f(a/j,j); //???????????
return num; //????
}
int main()
{
int n,i,out,a; //n???????out???????a??????
cin>>n;
for (i=0;i<n;i++)
{
cin>>a;
out=f(a,2); //??????
cout<<out<<endl;
}
return 0;
} | 1 |
109 | int g(int y)
{
int i;
for(i=0;;i++)
{
if(i*i>y)
break;
}
return i-1;
}
int f(int x,int b)
{
int p,a[100],t=0,k=0;
p=g(x);
if(x==2)
return 0;
else
{
for(int i=b;i<=p;i++)
{
if(x%i==0)
{
a[t]=i;
t++;
}
}
if(t==0)
return 0;
else
for(int i=0;i<t;i++)
k=k+f(x/a[i],a[i])+1;
return k;
}
}
int main()
{
int n,a;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a;
cout<<f(a,2)+1<<endl;
}
return 0;
} | 1 |
110 | int main(){
int hanshu(int k,int min);
int n,i,a;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a);
printf("%d\n",hanshu(a,2));
}
scanf("%d",&n);
return 0;
}
int hanshu(int k,int min){
int j,a[k],b=1;
if(k<min)return 0;
for(j=min;j<=k/j;j++){
if(k%j==0){
b+=hanshu(k/j,j);
}
}
return(b);
}
| 1 |
111 |
int t=0;
int mini(int k,int i)//a?ˆ ˝o?÷÷?÷?®?¨?›?虫Ûk?Û⁄i
{
if(k==1)t=t+1;
for(;i<=k;i++)
{
if(k%i==0)mini(k/i,i);
}
return 0;
}
int main()
{
int N,n;
scanf("%d",&N);
for(n=0;n<=N-1;n++)
{
int M;
scanf("%d",&M);
mini(M,2);
printf("%d\n",t);
t=0;
}
}
| 1 |
112 | int f(int a,int min){
if(a<min)
return 0;
int sum=1;
for(int i=min;i<a;i++){
if(a%i==0)
sum+=f(a/i,i);
}
return sum;
}
int main(){
int n;
int a[100];
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
a[i]=f(a[i],2);
}
for(int i=0;i<n;i++){
printf("%d\n",a[i]);
}
return 0;
}
| 1 |
113 | //
// main.cpp
// 123
//
// Created by blues cookie on 12-11-12.
// Copyright (c) 2012? blues cookie. All rights reserved.
//
int calc(int a,int b)
{
if(a*a>b) return 1;
if(b%a==0) return (calc(a,b/a)+calc(a+1,b));
return calc(a+1,b);
}
int main(int argc, const char * argv[])
{
int n,a;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a;
cout<<calc(2,a)<<endl;
}
return 0;
} | 1 |
114 | int sum=0; //???????
void fj(int n,int m)
{
int i; //?????
for(i=m;i<=sqrt(n);i++) //???????
{
if(n%i==0)
{
sum++;
fj(n/i,i); //???????
}
}
}
int main()
{
int j,N; //??????????????
int a[100]; //?????
cin>>N;
for(j=1;j<=N;j++)
{
cin>>a[j]; //?????
}
for(j=1;j<=N;j++)
{
sum=0;
fj(a[j],2); //?????
cout<<sum+1<<endl;
}
return 0;
}
| 1 |
115 |
int f(int a,int min)
{
if(a < min)
{
return 0;
}
int r= 1;
for(int i = min;i<a;i++)
{
if(a%i == 0)
{
r+= f(a/i,i);
}
}
return r;
}
main()
{
int n,a,i,j=0,k,m=0,r=0;
scanf("%d",&n);
for(k=0;k<n;k++)
{
scanf("%d",&a);
if(k!=n-1)
printf("%d\n",f(a,2));
else
printf("%d",f(a,2));
}
} | 1 |
116 | int main()
{
int f(int,int);
int n,a;
cin>>n;
while(n--)
{
cin>>a;
cout<<f(a,a)<<endl;
}
return 0;
}
int f(int m,int k)
{
int i,sum=0;
if(m==1) sum=1;
for(i=m;i>1;i--)
{
if(m%i==0&&i<=k)
sum+=f(m/i,i);}
return sum;
} | 1 |
117 | int means(int,int);
int main()
{
int n,i=0;
cin>>n;
while(i<n)
{
int a;
cin>>a;
cout<<means(a,a)<<endl;
i++;
}
return 0;
}
int means(int a,int b)
{
int i,sum=0;
if(a!=1)
{
for(i=b;i>=2;i--)
{
if(a%i==0)
{
sum=sum+means(a/i,i); //?i????a??????a/i???a/i??????i????????????
}
}
return sum; //?????a???????????
}
else
{
return 1; //?a=1?????????1
}
} | 1 |
118 | int m[100],i;
void sb(int,int);
int main()
{
int n,a[100];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
{
sb(a[i],2);
printf("%d\n",m[i]+1);
}
return 0;
}
void sb(int c,int d)
{
int v;
for(v=d;v<=sqrt(c);v++)
{
if(c%v==0)
{
m[i]++;
sb(c/v,v);}}
}
| 1 |
119 | /*************************************************************************************************************
* @file .cpp
* @author ????
* @date
* @description
* ????
*/
int i;
int fenjie( int x, int t)
{
int j;
if(x == 1 || x == 2)
return 1;
int s = 1;
for (j = t; j <= sqrt(x); j++)
{
if (x % j == 0)
s += fenjie((x / j), j);
}
return s;
}
int main()
{
int n, a[100],x,t;
cin >> n;
for (i = 0; i < n; i++)
{
cin >> x;
a[i] = fenjie(x,2);
}
for(i = 0; i < n; i++)
cout << a[i] << endl;
return 0;
} | 1 |
120 | int Factorization(int,int);
int main()
{
int n=0,num=0;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>num;
cout<<Factorization(num,2)+1<<endl;
}
return 0;
}
int Factorization(int num,int n)
{
int count=0;
for(int i=n;num/i>=i;i++)
if(num%i==0)
{
count++;
count=count+Factorization(num/i,i);
}
return count;
}
| 1 |
121 | /*
* fengjie.cpp
*
* Created on: 2013-11-23
* Author: sony
*/
int sum;
void f(int x,int i){
if (x == 1) sum++;
for(;i<=x;i++)
if (x%i == 0) f(x/i,i);
return;
}
int main(){
int t,a,i=2;
cin>>t;//????????
for (a = 0; a<t ; a++){
int x;
cin >> x;
int ans = 1;
for(i = 2; i<sqrt(x) ; i++){
sum = 0;
if(x%i == 0) f(x/i,i);
ans = ans + sum;
}
cout<<ans<<endl;
}
return 0;
}
| 1 |
122 | int k=0;
int y;
int a(int x,int i);
void b(int x,int i);
int main()
{
int n,i,x,z;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&x);
y=x;
printf("%d\n",a(x,2));
}
return 0;
}
int a(int x,int i)
{
k=0;
b(x,i);
return k;
}
void b(int x,int i)
{
for(i=i;i<=x;i++)
{
if(x%i==0) b(x/i,i);
}
if(x==1) k=k+1;
} | 1 |
123 | void f(int i,int m);
int sum;
int main()
{
int n,i,m,k;
scanf("%d",&n);
for(i=0;i<n;i++)
{ sum=1;
scanf("%d",&m);
f(2,m);
printf("%d\n",sum);
}
}
void f(int i ,int m)
{
int k,s;
s=(int)sqrt(m);
for(k=i;k<=s;k++)
{
if(m%k==0)
{
sum++;
f(k,m/k);
}
}
} | 1 |
124 | void qut(int a,int b); //????
int num=0; //?????????
int main()
{
int i,n,g[1000]; //?????????
cin>>n;
for(i=0;i<n;i++) //??????
cin>>g[i];
for(i=0;i<n;i++)
{
qut(g[i],1); //????
cout<<num<<endl;
num=0;
}
return 0;
}
void qut(int a,int b)
{
int i;
if (a>=b)
{
num++;
if (b==1)
b++;
for (i=b;i<=a;i++)
{
if (a%i==0)
{
qut(a/i,i); //??a%i==0,??
}
}
}
}
| 1 |
125 | int fenjie(int n,int min)
{int i,a=0,x=0;
for(i=2;i<=n;i++)
if(n%i==0)
a=a+1;
if(n==1)
return 1;
else
{
for(i=min;i<=n;i++)
{
if(n%i==0)
x=x+fenjie(n/i,i);
}
return x;
}
}
main()
{
int t,j,num;
scanf("%d",&t);
for(j=1;j<=t;j++)
{
scanf("%d",&num);
printf("%d\n",fenjie(num,2));}
} | 1 |
126 | int func(int m,int q)
{
int b[100];
int i,j,k=0,p=0,sum=1;
for (j=q;j<=m;j++)
{
if (j*j>m)
{
p=k;
break;
}
if (m%j==0)
{
b[k]=j;
k++;
}
}
if (k>2||p!=0&&m!=2)
{
for (i=0;i<p;i++)
{
sum+=func(m/b[i],b[i]);
}
return (sum);
}
else
return (1);
}
main()
{
int i,j,k=0,n,m,b[100]={0},a[100]={0};
scanf("%d",&n);
for (i=0;i<n;i++)
{
scanf("%d",&m);
b[i]=func(m,2);
}
for (j=0;j<i;j++)
{
printf("%d\n",b[j]);
}
} | 1 |
127 | int n,m;
int sum(int x,int y)
{
int c,i;
if(x>sqrt(y))
c=0;
else
{
if(y%x==0)
{
for(i=x,c=1;i<=(y/2)+1;i++)
{
if((y/x)%i==0)
c=c+sum(i,(y/x));
}
}
else
c=0;
}
return(c);
}
main()
{
int i,k,j;
scanf("%d",&n);
for(j=1;j<=n;j++)
{
k=0;
scanf("%d",&m);
for(i=2;i<=(m/2)+1;i++)
k=k+sum(i,m);
printf("%d\n",k+1);
}
}
| 1 |
128 | int t=0,ways; //??????t?ways
void divide(int x,int h)
{
int i;
if(x==1) //??x==1
{t++;ways=t;} //t+1?ways?????t
else
for(i=h;i<=x;i++)
if(x%i==0)
{h=i;
divide(x/h,h); //h?????????????divide?????????
}
}
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{cin>>a[i];
t=0;divide(a[i],2);
cout<<ways<<endl;}
return 0;
} | 1 |
129 | int disassamble(int, int);
int main()
{
int n;
int i = 1;
int a, result;
cin >> n;
while(i <= n)
{
i++;
cin >> a;
result = disassamble(a, 2);
cout << result << endl;
}
return 0;
}
int disassamble(int a, int y)
{
int i, count = 1;
if(a == 1)
return 0;
if(a == 2)
return 1;
for(i = y; i * i <= a; i++)
{
if(a % i == 0)
{
count = disassamble(a / i, i) + count;
}
}
return count;
} | 1 |
130 | /*????
* divide.cpp
*
* Created on: 2011-12-1
* Author: WJ
*/
int sum=1; //?????1?????
void f(int b,int a) //??????????????
{
for(int i=b;i<=a;i++){ //????????
if((a%i==0)&&(i<=a/i)){
sum=sum+1; //???1
f(i,a/i); //???????????
}
if(i>a/i) break;
}
}
int main()
{
int a,n;
cin>>n;
while(n>0){ //??????
cin>>a;
sum=1;
f(2,a); //????
cout<<sum<<endl; //????
n--;
}
return 0;
}
| 1 |
131 |
int devide(int n,int m)
{
if(n<m)
m=n;
if(n==1)//?????1?,??1
return 1;
int sum=0;
for(int i=m;i>=2;i--)
{
if(n%i==0)
{
sum=sum+devide(n/i,i);
}
}
return sum;
}
int main()
{
int n,i,m;
cin>>n;
i=0;
while ( i<n )
{
cin>>m;
cout<<devide (m,m)<<endl;//???????
i++;
}
return 0;
} | 1 |
132 | int f(int N, int min)
{
int s=1, i;
if(N < min)
return 0;
for(i = min; i < N; i++ )
{
if(N%i==0)
{
s += f(N/i, i);
}
}
return s;
}
int main()
{
int n, i, b = 2;
int a[100];
scanf("%d", &n);
for(i = 0; i < n; i++)
scanf("%d", &a[i]);
for(i = 0; i < n; i++)
printf("%d\n", f(a[i], b));
return 0;
} | 1 |
133 |
int main()
{
int n,i;
int a,num(int,int);
cin>>n;
for (i=0;i<n;i++)
{
cin>>a;
cout<<num(2,a)+1<<endl;
}
return 0;
}
int num(int m,int n)
{
int i,count=0;
int su(int);
for (i=m;i<=(int)sqrt(n);i++)
if (n%i==0)
{
count++;
if (su(n/i)!=0)
count+=num(i,n/i);
}
return count;
}
int su(int n)
{
int i;
for (i=2;i<n;i++)
if (n%i==0)
{
return 1;
break;
}
if (i==n)
return 0;
} | 1 |
134 | int sum;
int yin(int c,int g)//?????
{
int j,k,f,e;
for(j=g;j<=c;j++)//??
{
if(c%j==0)
{
e=c/j;
if(e>1)
{
f=j;
yin(e,f);
}
else sum++;//?????????
}
}
return sum;//??
}
int main()
{
int n,a[1000],b[1000],i,d;
cin>>n;
for(i=0;i<n;i++) cin>>a[i];//??
for(i=0;i<n;i++) {d=2;sum=0;b[i]=yin(a[i],d);}
for(i=0;i<n;i++) cout<<b[i]<<endl;//??
return 0;
}
| 1 |
135 | /*
* huisu.cpp
* ????
* Created on: 2010-11-26
* Author: ???
*/
int a=0,i=0,sum=1; //sum?????????????????????????1
void f(int i,int a) { //f????????
int j;
for(j=i;j<=sqrt(a);j++)
if(a%j==0) {sum++; f(j,a/j);} //?a??j?????????1????????????,????
} //???j??????????????3*13?13*3
int main(){
int n;
cin>>n;
while (n){
cin>>a;
f(2,a);
cout<<sum<<endl;
n--;
sum=1; //??sum
}
}
| 1 |
136 | int wtf(int p,int a);
int main()
{
int n,i,a,p;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a);
printf("%d\n",wtf(2,a));
}
return 0;
}
int wtf(int p,int a)
{
int i,ways=0,j=0;
int m=(int)sqrt(a);
for(;p<=m;p++)
{if(a%p==0 && a>=p*p ) {ways=ways+wtf(p,a/p);j++;}}
if(j==0)
return 1;
else
return ways+1;
}
| 1 |
137 | //*************************************************
//*file: 1000012912_006.cpp *
//*author: ??? *
//*date?2010.12.01 *
//*function????? *
//*************************************************
int sum(int); //sum??????????a=a?
int g_count, g_j; //count???-1,j?????
int main()
{
int n, a, i; //n????a?????
cin >> n;
for ( i = 0; i < n; i ++ )
{
g_count = 0;
g_j = 2;
cin >> a;
cout << sum(a) + 1 << endl;
}
return 0;
}
int sum( int a)
{
int i, b;
b = (int)sqrt( (double)a );
for ( i = g_j; i <= b; i++ )
{
if ( a % i == 0 ) //?a??i????????????1
{
g_j = i; //j??i???????
g_count++;
sum( a / i );
}
}
return g_count;
}
| 1 |
138 | /**
* @file ????.cpp
* @author ?? 1000012792
* @date 2010.12.3
*/
int f(int n, int m); //??f:????m????n?????????????????
int main()
{
int n, num, i;
cin >> n; //n???n???
for(i=0;i<n;i++)
{
cin >> num; //????????num,????????
cout << f(num, 2) << endl;
}
return 0;
}
int f(int n, int m)
{
int i, count=0;
if(n==1)
return 1; //??n=1?????????1
for(i=m;i<=n;i++) //?????i?m?????n??
{
if(n%i==0) //??n??i???????n/i????(???????i)???????f(n/i,i)
count += f(n/i,i); //count?????????
}
return count; //??count??
} | 1 |
139 | /*
* h35.cpp
* function:????
* Created on: 2012-11-30
* Author: sear
*/
//m????n???????????n???n??m,????n,???n??1
int f(int m, int n) { //m???,n????????
int i, sum = 0; //i?????,sum???????
if (n == 1)
return 1; //???????1???1
for (sum = 0, i = m; i <= n; i++)//?????????????????m???????m???
if (n % i == 0)
sum += f(i, n / i);//?n???????????n??i????
return sum; //??sum???????
}
int main() {
int i, n, k; //i?????,n????????,k?????????
for (i = 0, cin >> n; i < n; i++) {
cin >> k; //???????
cout << f(2, k) << endl;//???????
}
return 0; //????
}
| 1 |
140 | /*
* 187.cpp
*
* Created on: 2011-11-22
* Author: think
*/
int count(int a,int n){
if(a>n)return 0;
if(a==n)return 1;
int p=1;
int i;
for(i=a;i<=n;i++){
if(n%i==0&&i<=n/i){
p=p+count(i,n/i);
}
}
return p;
}
int geshu(int N){
int i;
int s=1;
for(i=2;i<=sqrt(N);i++){
if(N%i==0){
s=s+count(i,N/i);
}
}
return s;
}
int main(){
int N;
cin>>N;
int c[N];
int j;
for(j=0;j<N;j++){
cin>>c[j];
}
for(j=0;j<N;j++){
cout<<geshu(c[j])<<endl;
}
return 0;
}
| 1 |
141 | int de(int s,int a){ //???????a???????s?????????
int sum=0; //?????????????
if(a==1)return 1; //a?????????????????
else if(s>a)return 0; //a?????????????????????
for(int i=s;i<=a;i++) //for????a??????????
if(a%i==0)sum=sum+de(i,a/i); //?????????????????????
return sum; //??????
}
int main(){ //???
int n; //??????n????????
cin>>n; //??n??
while(n>0){ //while??????????
int a; //??????a
cin>>a; //??a??
cout<<de(2,a)<<endl; //???a???????2??????????
n--; //n???
}
return 0; //?????????????????
} | 1 |
142 |
int f(int a,int x)
{
int count=1,i;
for(i=x;i<a;i++)
if(a%i==0)
count+=f(a/i,i);
if(i==a)
return count;
else
return 0;
}
void main()
{
int n,a;
scanf("%d",&n);
for(;n>0;n--)
{
scanf("%d",&a);
if(a==1||a==2)
printf("1\n");
else
printf("%d\n",f(a,2));
}
}
| 1 |
143 | int f(int a,int min);
int main()
{
int n,i,a;
cin>>n;
for(i=0;i<n;i++){
cin>>a;
printf("%d\n",f(a,2));}
return 0;
}
int f(int a,int min)
{
if(a < min){
return 0;}
int result = 1;
for(int i = min;i<a;i++){
if(a % i == 0){
result += f(a/i,i);}}
return result;
} | 1 |
144 | int main()
{
int f(int a,int b);
int n,a;
cin>>n;
while(n>0)
{
cin>>a;
cout<<f(a,2)<<endl;
n--;
}
return 0;
}
int f(int a,int b)
{
int i;
int s=1;
if(a<b)
return 0;
for(i=b;i<a;i++)
{
if(a%i==0)
s=s+f(a/i,i);
}
return s;
} | 1 |
145 |
int s=0;
void find(int min,int dev)
{
int i;
for(i=min;i<=sqrt((float)dev);i++)
if(dev%i==0)
{
s++;
find(i,dev/i);
}
}
int main()
{
int n,i,m,j;
scanf("%d",&m);
for(j=1;j<=m;j++){
scanf("%d",&n);
for(i=2;i<=sqrt((float)n);i++)
if(n%i==0)
{
s++;
find(i,n/i);
}
printf("%d\n",s+1);s=0;}
//getchar();
//getchar();
return 0;
} | 1 |
146 | int sum = 0;
void f(int a,int s)
{
int i;
if(a == 1)
sum++;
else
{
for(i = s; i <= a; i++)
{
if(a % i == 0)
f((a / i),i);
}
}
return;
}
int main()
{
int n, num, j;
cin >> n;
for (j = 1; j <= n; j++)
{
cin >> num;
f(num,2);
printf("%d\n",sum);
sum = 0;
}
return 0;
}
| 1 |
147 | void main()
{
int fac(int a,int b);
int n,i,m,a[100];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
{
m=fac(a[i],2);
printf("%d\n",m);
}
}
int fac(int a,int b)
{
int j,i;
if(a<b) j=0;
else
{
j=1;
for(i=b;i<a;i++)
{
if(a%i==0) j=j+fac(a/i,i);
}
}
return(j);
}
| 1 |
148 | /*
*????HW7_10.cpp
*??????1100019007?
*???2012-11-14
*???1090 ????
*/
int factorize(int m,int k)
{
int c=1;//a=a???
if(m<4)return 1;//?m??4??1
for(int i=k;i<=sqrt(m);i++)if(!(m%i))c+=factorize(m/i,k>i?k:i);//????????????????an>an-1,???k???
return c;//?????
}
int main(int argc, char *argv[]){
int n,m;
cin>>n;
while(n--){
cin>>m;//????
cout<<factorize(m,2)<<endl;//????
}
return 0;}
| 1 |
149 | int elm[100]={0};
int counts=0,num=0;
void Try(int b,int s)
{
int j;
for(j=2;j<=num;j++)
{
if(j>=elm[s-1])
{
if(b%j==0)
{
elm[s]=j;
if(b/j==1)
counts++;
else if(b/j<j)
continue;
else
Try(b/j,s+1);
}
}
}
}
int main()
{
int n,i;
cin>>n;
for(i=0;i<n;i++)
{
counts=0;
cin>>num;
Try(num,1);
cout<<counts<<endl;
}
return 0;
}
| 1 |
150 | int ys(int af,int bf)
{
int s;
if(af<bf)
s=0;
if(af==bf)
s=1;
if(af>bf)
{
s=1;
for(int i=af/2;i>=bf;i--)
{
if(af%i == 0)
{
s+=ys(af/i,i);
}
}
}
return s;
}
int main()
{
int n;
cin >> n;
int p;
while(cin>>p)
{
cout << ys(p,2) << endl;
}
return 0;
}
| 1 |
151 | int i=0;
int f(int n,int m)
{int k=0;
if(m==1)
i++;
else
{for(k=n;k<=m;k++)
{if(m%k==0)
{n=k;
f(n,m/n);}}}
return(i);}
int main()
{
int n,b,c;
cin>>n;
int a;
for(b=0;b<n;b++)
{cin>>a;
c=f(2,a);
cout<<c<<endl;
i=0;}
return 0;
}
| 1 |
152 | /*
*???: ????.cpp
*??????
*????: 2012-11-12
*??: ????????????
*/
int count(int num, int m)
//???????????????????a1????????????
{
if (num % m != 0) return 0;
if (num == m) return 1;
else {
int counter = 0;
for (int i = m; i <= num / m; i++){
counter += count(num / m, i);
}
return counter;
}
}
int main ()
{
int n,num;
cin >>n;
for (int i = 1; i <= n; i++){
int counter = 0;
cin >> num;
for (int i = 2; i <= num; i++)
counter += count(num,i);//a1???2???m???
cout << counter << endl;
}
return 0;
} | 1 |
153 | int p(int x)
{
int i;
for(i=2;i<=sqrt(x);i++) if(x%i==0) return(0);
return(1);
}
int f(int n,int m)
{
int t,i;
if(n<m) return(0);
else if(p(n)==1) return(1);
else if(m==1)
{
t=1;
for(i=m+1;i<n;i++)
{
if(n%i==0) t=t+f(n/i,i);
}
}
else if(m!=1)
{
t=1;
for(i=m;i<n;i++)
{
if(n%i==0) t=t+f(n/i,i);
}
}
return(t);
}
main ()
{
int x,y,z,j;
scanf("%d",&y);
for(j=0;j<y;j++)
{
scanf("%d",&x);
printf("%d\n",f(x,1));
}
} | 1 |
154 | /*
* Created on: 2011-11-18
* Author: 1100012870
*/
int su[40000],b[10000],ans;
void zhaosushu()
{
int i,j,p;
for(i=2;i<32768;i++)
{
p=1;
for(j=2;j<=sqrt(i);j++)
if(i%j==0){
p=0;
break;
}
if(p==0)continue;
su[p]=1;
}
}
void resolve(int a,int x)
{
int i;
if(a==1 || (su[a]==1 && a>=b[x-1])) {
ans++;
return;
}
for(i=2;i<=a;i++)
if(a%i==0 && i>=b[x-1]){
b[x]=i;
resolve(a/i,x+1);
b[x]=0;
}
}
int main()
{
int n,i,a;
memset(su,0,sizeof(su));
zhaosushu();
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a;
ans=0;
memset(b,0,sizeof(b));
resolve(a,1);
cout<<ans<<endl;
}
return 0;
} | 1 |
155 | int main()
{
int f(int a,int min);
int n,a[150],i,b;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
b=f(a[i],2);
printf("%d\n",b);
}
return 0;
}
int f(int a,int min)
{
int result=1,i;
if(a < min)
{
return 0;
}
for(i = min;i<a;i++)
{
if(a % i == 0)
{
result += f(a/i,i);
}
}
return result;
} | 1 |
156 | int sum=0; //?????????????
void ways(int a,int last);
int main()
{
int n,num[100],i;
cin>>n;
for(i=0;i<n;i++)
{
cin>>num[i];
}
for(i=0;i<n;i++)
{
ways(num[i],2); //??????????
cout<<sum<<endl; //??
sum=0;
}
return 0;
}
void ways(int a,int last)
{
int i,j;
for(i=last;i<=a;i++)
{
if(a<i) //????????????????????????
{
}
else if(a==i) //???????????u?????
{
sum++;
}
else if(a%i==0) //????????????????????????????????
{
ways(a/i,i);
}
}
}
| 1 |
157 | int fenjie(int max,int min)
{
int num=1,i,k;
for(i=min;i<max/2;i++)
{
k=max%i;
if(k==0)
{
if(i<=max/i)
num+=fenjie(max/i,i);
}
}
return num;
}
int main()
{
int a[10000],n,j;
scanf("%d",&n);
for(j=0;j<n;j++)
{
scanf("\n%d",&a[j]);
}
for(j=0;j<n;j++)
{
printf("%d\n",fenjie(a[j],2));
}
return 0;
} | 1 |
158 |
int sort(int, int, int);
int main()
{
int t=0;
cin>>t;
int k=1;
for (k=1;k<=t;k++)
{
int vacancy=0;
int num=1;
cin>>num;
int i=1;
int temp=num;
for (i=2;i<=temp;i++)
{
while (temp%i==0)
{
vacancy=vacancy+1;
temp=temp/i;
}
}
cout<<sort(1,vacancy,num)<<endl;
}
return 0;
}
int sort(int start, int vacancy, int num)
{
if (num<start)
return 0;
if (vacancy==1)
return 1;
int sum=0;
int i=1;
for (i=start;i<=num;i++)
{
if (num%i==0)
{
sum=sum+sort(i,vacancy-1,num/i);
}
}
return sum;
} | 1 |
159 | int f(int a,int s)
{
int y=0;
for (;s<=a;s++)
{
if (s==a)
y+=1;
else if (s>1&&a%s==0)
y+=f(a/s,s);
}
return y;
}
main ()
{
int n,i,a;
scanf ("%d",&n);
for (i=0;i<n;i++)
{
scanf ("%d",&a);
printf ("%d\n",f(a,1));
}
} | 1 |
160 | //????
int f(int x,int min){
if(x<min) return 0;
int r=1;
for(int i=min;i<x/2;i++){
if(x%i==0){
r+=f(x/i,i);
}
}
return r;
}
int main(){
int n;
cin>>n;
while(n--){
int x;
cin>>x;
cout<<f(x,2)<<endl;
}
}
| 1 |
161 | //============================================================================
// Name : hanshu0109.cpp
// Author : 1300012911
// Version : 20131120,Wed,11th week
// Copyright :
// Description : ????
//============================================================================
int fenjie(int a,int max){//a:?????max??1??????????????
int i = 0;
int sum = 0;//????
if (a == 1) return 1;//1???????1??????
for (i = max;i >= 2;i--)
{
if ((a % i) == 0) sum += fenjie(a/i,i);//i??????
}
return sum;//????
}
int main() {
int k = 0;
int n = 0;
int num = 0;
cin >> n;//??
for (k = 1;k <= n;k++)
{
cin >> num;//?????
cout << fenjie(num,num);//????????
if (k < n) cout << endl;
}
return 0;
}
| 1 |
162 |
int factorize(int n,int j)
{
int F=1;
for(;j<=sqrt(n);j++)
if(n%j==0)
F+=factorize(n/j,j);
return F;
}
int main()
{
int i,m,n[1000];
scanf("%d",&m);
for(i=0;i<m;i++)
scanf("%d",&n[i]);
for(i=0;i<m;i++)
printf("%d\n",factorize(n[i],2));
return 0;
} | 1 |
163 | int factoring(int a,int b)
{
int i,kind=0;
if(a==1)
{
kind=1;
}
else
{
for(i=b;i<=a;i++)
{
if(a%i==0)
{
kind=factoring(a/i,i)+kind;
}
}
}
return kind;
}
int main()
{
int n,i,j,a[30000]={0},b[30000]={0};
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
b[i]=factoring(a[i],2);
}
for(i=0;i<n;i++)
{
printf("%d\n",b[i]);
}
return 0;
} | 1 |
164 | int sum=0,used[32770]={0};//????sum???????????used?i???i????????
void f(int n)//??f??n????????
{
for(int i=2;i<=n;i++)
{
if(n%i==0&&used[i]==0)
{
if(i!=2)
{
for(int j=2;j<=i-1;j++)
used[j]=1;
}
if(n/i==1)//??????????
{
sum++;
break;
}
else
{
f(n/i);
}
memset(used,0,sizeof(used));//?used???????
}
}
}
int main()
{
int m,a[100];
cin>>m;
for(int i=1;i<=m;i++)
{
cin>>a[i];
if(a[i]==1)
cout<<1<<endl;
else
{
f(a[i]);
cout<<sum<<endl;
sum=0;//??
memset(used,0,sizeof(used));
}
}
return 0;
} | 1 |
165 | /*1090 ????*/
int num;
void divide(int a,int k)
{
int i;
if(a==1) num++;//??????????????
for(i=k;i<=a;i++)//????????
if(a%i==0) divide(a/i,i);
}
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
num=1;
int i;
for(i=2;i*i<=n;i++)
if(n%i==0) divide(n/i,i);
cout<<num<<endl;
}
return 0;
} | 1 |
166 | /*
* 1000012739_34_1.cpp
*
* Created on: 2010-12-3
* Author: ???
* Title: 1090 ????
*/
int cnt=0; //????????
void slv(int nm,int pr) //nm????????pr???????
{
int i;
if (nm>=pr) //???????????
{
cnt++; //??????
if (pr==1) //???????????2??
pr++;
for (i=pr;i<=nm;i++) //??????
{
if (nm%i==0) //??nm???
{
slv(nm/i,i); //nm??i???
}
}
}
}
int main()
{
int n,i,num;
cin>>n; //??????
for (i=1;i<=n;i++)
{
cnt=0; //???????
cin>>num; //????
slv(num,1); //??cnt
cout<<cnt<<endl; //??cnt
}
} | 1 |
167 | //*****************************
//* ??????? *
//* ?????? *
//* ???2010-12-7 *
//*****************************
int num=1,flag=2;//????1?????,?????
void way(int);
int main()
{
int a,n;
cin>>n;
while(n--)
{
cin>>a;
way(a);
cout<<num<<endl;
num=1;
flag=2;//???
}
return 0;
}
void way(int a)
{
int i,max;
max=sqrt(a);
for(i=flag;i<=max;i++)//?????????????????????
{
if(a%i==0)//????????
{
flag=i;//??
num++;
way(a/i);//???????????????????
}
}
}
| 1 |
168 | int sum=0;
void f(int x, int i)
{
double m=sqrt(x);
if(i<m)
{
if(x%i==0)
{
sum++;
f(x/i,i);
}
f(x,i+1);
}
if(fabs(i-m)<0.00000001)
sum++;
}
int main()
{
int x,i,n;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d",&x);
sum=0;
f(x,2);
printf("%d\n",sum+1);
}
return 0;
}
| 1 |
169 | int Digui(int a,int min)
{
int i,result=1;
if(a<min)
{
return 0;
}
for(i=min;i<a;i++)
{
if(a%i==0)
{
result+=Digui(a/i,i);
}
}
return(result);
}
int main()
{
int a[1000],n,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
printf("%d\n",Digui(a[i],2));
}
return 0;
}
| 1 |
170 | int function(int num,int k)
{
int j;
int m=0;
if(num>1)
{for(j=k;j<=num;j++)
{if(num%j==0)
{m=m+function(num/j,j);}
}
return m;
}
else
return 1;
}
int main()
{int i,j;
int n;
cin>>n;
int num[100];
for(i=0;i<n;i++)
{cin>>num[i];}
for(i=0;i<n;i++)
{cout<<function(num[i],2)<<endl;
}
return 0;
} | 1 |
171 | //**************************************
//**???12.1?????? ***
//**????? ???1000012888 ***
//**************************************
int f(int, int);//??f??????????
int main()
{
int n, a, i;
cin >> n;
for (i = 1; i <= n; i++)
{
cin >> a;
cout << f(a, 2) << endl;
}
return 0;
}
int f(int x, int b)//f(a,b)?a?????b?????????
{
int j, re = 1;//??a=a???????re???0
if(x < b)
return 0;
for (j = b; j < x; j++)
{
if(x % j == 0)
re = re + f(x / j, j);//????????????????
}
return re;//??re
} | 1 |
172 | int sum=1;
void f(int i,int j)
{
int k;
if(i==1)
sum++;
else
{
for(k=j;k<=i;k++)
{
if(i%k==0)
f(i/k,k);
}
}
}
int main(void)
{
int i,j,k;
int n;
int a;
scanf("%d",&n);
while(n--)
{
sum=1;
scanf("%d",&a);
for(i=2;i*i<=a;i++)
{
if(a%i==0)
{
f(a/i,i);
}
}
printf("%d\n",sum);
}
return 0;
} | 1 |
173 | //
// main.c
// ???? ? ??????????
//
// Created by zhaoze on 13-11-5.
// Copyright (c) 2013? zhaoze. All rights reserved.
//
void next(int c[],int x)
{
int i,j;
c[0]++;
for (i=1; c[0]*c[1]*c[2]*c[3]*c[4]*c[5]*c[6]*c[7]*c[8]*c[9]*c[10]*c[11]*c[12]*c[13]*c[14]>x; i++)
{
c[i]++;
for (j=0; j<i; c[j++]=c[i]);
if (c[14]==2) break;
}
}
int reslove(int x)
{
int c[15]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int p=0;
while (c[0]*c[1]*c[2]*c[3]*c[4]*c[5]*c[6]*c[7]*c[8]*c[9]*c[10]*c[11]*c[12]*c[13]*c[14]<=x)
{
if (c[0]*c[1]*c[2]*c[3]*c[4]*c[5]*c[6]*c[7]*c[8]*c[9]*c[10]*c[11]*c[12]*c[13]*c[14]==x) p++;
next(c, x);
}
return p;
}
void main()
{
int i=0,n,a;
scanf("%d",&n);
while (i++<n)
{
scanf("%d",&a);
printf("%d\n",reslove(a));
}
/*
*int c[15]={2,2,2,2,1,1,1,1,1,1,1,1,1,1,1};
*int x=20;
*{next(c, x);
*printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n",
* c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14]);}
*/
} | 1 |
174 | int ispr(int t)
{
int v=sqrt(t*1.0)+1;
for(int i=2; i<v; i++)
if(t%i==0)
return 0;
return 1;
}
int sum=0;
void fun(int n,int i) {
if(n==1)
sum++;
while(i<=n) {
if(n%i==0)
fun(n/i,i);
i++;
}
return ;
}
int main() {
int n;
scanf("%d",&n);
while(n--) {
int a;
scanf("%d",&a);
if(ispr(a)) {
printf("1\n");
continue;
}
int i=2,res=1;
while(i<=a/2) {
if(a%i==0) {
sum=0;
fun(a/i,i);
res+=sum;
}
i++;
}
printf("%d\n",res);
}
} | 1 |
175 | int num=0;
void yinshu(int x,int y)
{
if (x==y) num++;
else if ((x%y==0)&&(x>y)) {yinshu(x/y,y);yinshu(x,y+1);}
else if (x>y) yinshu(x,y+1);
}
int main()
{
int n,x;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x;
yinshu(x,2);
cout<<num<<endl;
num=0;
}
}
| 1 |
176 |
int f(int shu,int min)
{
int k=1;
if(shu < min)
{
k= 0;
return k;
}
else
{
for(int i = min;i<shu;i++)
{
if(shu%i == 0)
{
k=k+ f(shu/i,i);
}
}
return k;
}
}
main()
{
int n,i,a;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a);
if(i!=n-1)
printf("%d\n",f(a,2));
else
printf("%d",f(a,2));
}
} | 1 |
177 | int s=0;
void f(int x,int y)
{
int i,j,k;
if(x==1)
s++;
else
{
for(;y<=x;y++)
{
if(x%y==0)
{
f(x/y,y);
}
}
}
}
int main()
{
int n,k,q,j;
scanf("%d",&q);
for(j=0;j<q;j++)
{
scanf("%d",&n);
f(n,2);
printf("%d\n",s);
s=0;
}
return 0;
} | 1 |
178 | int d(int,int);
int main()
{
int i,n,x;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>x;
cout<<d(x,2)<<endl;
}
return 0;
}
int d(int x,int y)
{
int j,num=1;
if(x==1)
return 0;
if(x==2)
return 1;
for(j=y;j<=(int)sqrt((double)x);j++)
if(x%j==0)
num+=d(x/j,j);
return num;
}
| 1 |
179 | //********************************
//*????
//********************************
int f(int a, int b)
{
if (a == 1)
return 1;
else
{
int c,d,i;
c = 0;
d = (int)sqrt((double)a);
for (i = b; i <= a; i ++)
{
if (!(a % i))
c+= f(a / i,i);
}
return c;
}
}
int main()
{
int n,a,i;
cin >> n;
for (i = 0; i < n; i++)
{
cin >> a;
cout << f(a,2) << endl;
}
cin.get();
cin.get(); //????
return 0;
}
| 1 |
180 | int divide(int d,int n)
{
int sum=0;
for(int i=d;i<n;i++){
if (n%i==0&&(n/i)>=i){
sum=sum+1;
sum=sum+divide(i,n/i);}}
return (sum);
}
int main()
{
int n,num;
cin>>n;
for(int i=0;i<n;i++){
cin>>num;
cout<<divide(2,num)+1<<endl;}
return 0;
}
| 1 |
181 | int minf(int p,int min);
int main(){
int n,i,k,p,zs[20000]={0};
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&p);
//for(min=2;min<=(int)sqrt(p);min++){
//if(p%min==0){
zs[i]=minf(p,2);
//printf("%d\n",minf(p,min));
// }
//}
zs[i]++;
}
for(i=0;i<n-1;i++){
printf("%d\n",zs[i]);
}
printf("%d",zs[n-1]);
//scanf("%d",&n);
return 0;
}
int minf(int p, int min){
int x=0,i;
i=min;
for(i;i<=(int)sqrt(p);i++){
if(p%i==0){
x+=minf(p/i,i)+1;
}
}
return x;
} | 1 |
182 | int num=0;
void count(int m,int j)
{
int i;
if(m==1) num++;
for(i=j;i<=m;i++)
{
if(m%i==0) {count(m/i,i);}
else continue;}
}
int main()
{
int n,i;
cin>>n;
for(i=1;i<=n;i++)
{
int m;
cin>>m;
num=0;
count(m,2);
cout<<num<<endl;
}
return 0;
}
| 1 |
183 | int divide(int n,int j)
{
int sum=1,i,s,p,k;
s=sqrt(n);
for(i=j;i<=s;i++)
{
if (n%i==0)
{
p=n/i;
k=i;
sum=sum+divide(p,i);
}
}
return sum;
}
int main()
{
int n;
cin>>n;
int k,m,p;
for(k=0;k<n;k++)
{
cin>>m;
p=divide(m,2);
cout<<p<<endl;
}
return 0;
}
| 1 |
184 | int a;
int fj(int x, int y);
int main()
{
int n;
cin >> n;
int i;
for (i = 1; i <= n; i++)
{
cin >> a;
cout << fj(a, 2) << endl;
}
return 0;
}
int fj(int x, int y)
{
int xnumber = 1;
int i;
int b = sqrt(x);
if (x == 1) return 0;
else
for (i = y; i <= b; i++)
{
if (x % i == 0) xnumber = xnumber + fj(x / i, i);
}
return xnumber;
} | 1 |
185 | int division(int m,int k)
{
int num=0;
if(m>=k)
{
for(int i=k;i<=m;i++)
{
if(m==i) num++;
else if(m%i==0)
{
num+=division(m/i,i);
}
}
}
return num;
}
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
int a;
cin>>a;
cout<<division(a,2)<<endl;
}
return 0;
}
| 1 |
186 | int num=0;
int judge1(int n)
{
int i;
if(n==2||n==3||n==5)
return 1;
if(n==4)
return 0;
for(i=2;i*i<n;i++)
{
if(n%i==0)
{return 0;break;}
}
if(i*i>n)
return 1;
}
void divide(int n,int d)
{
for(int i=d;i*i<=n;i++)
{
if(n%i==0)//&&judge1(i))
{
num++;
divide(n/i,d);
}
d++;
}
}
int main()
{
int n,m;
cin>>n;
while(n)
{
n--;
cin>>m;
num=1;
divide(m,2);
cout<<num<<endl;
}
return 0;
} | 1 |
187 | int fenjie(int n,int min)
{
int x=0,i;
if(n==1)
return 1;
else
{
for(i=min;i<=n;i++)
{
if(n%i==0)
x=x+fenjie(n/i,i);}
}
return x;}
main()
{int shu;
int number,count=1;
scanf("%d",&number);
while(count<number)
{
scanf("%d",&shu);
printf("%d\n",fenjie(shu,2));
count++; }
scanf("%d",&shu);
printf("%d",fenjie(shu,2));
} | 1 |
188 | int main()
{
int count(int x,int y);
int i,j,n,a[100],b[100];
scanf("%d", &n);
for(i=1;i<=n;i++){scanf("%d", &a[i]);}
for(i=1;i<=n;i++){
b[i]=0;
for(j=2;j<=a[i];j++){
b[i]+=count(a[i],j);
}
}
for(i=1;i<=n;i++){printf("%d\n", b[i]);}
return 0;
}
int count(int x,int y)
{
int c=0,k;
if(x==y){c=1;}
if(x%y!=0){c=0;}
if(x!=y&&x%y==0){
for(k=y;k>=2;k--){c+=count((x/y),k);}
}
return(c);
}
| 1 |
189 | int sum=0;
int geshu(int a,int x)
{
int y,z;
z=a;
y=(int)sqrt(a);
while(x<=y)
{
if(a%x==0)
{
a=a/x;
geshu(a,x);
}
if(a==z/x)
a=z;
x++;
}
sum++;
return sum;
}
int main()
{
int n,i,a[100],b[100],x;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(a[i]==2||a[i]==3)
b[i]=1;
else
{
sum=0;
x=2;
b[i]=geshu(a[i],x);
}
}
for(i=0;i<n;i++)
{
printf("%d\n",b[i]);
}
} | 1 |
190 |
int sum[50];
int i;
int main()
{
void digui(int x, int y);
int n;
int j[50],m[50];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&m[i]);
sum[i]=0;
for (j[i]=2;j[i]*j[i]<=m[i];j[i]++)
{
if(m[i]%j[i]==0)
{
sum[i]++;
digui(j[i],m[i]/j[i]);
}
}
printf("%d\n",sum[i]+1);
}
return 0;
}
void digui(int x, int y)
{
int s;
for(s=x; s*s<=y; s++)
{
if(y%s==0)
{
sum[i]++;
digui(s,y/s);
}
}
}
| 1 |
191 | int count;
void f(int x,int y)
{
int i=0;
if(x>=y)
for(i=y;i<=x;i++)
{
if(i==x)count++;
if(x%i==0) f(x/i,i);
}
}
main()
{
int t;
int n,i,x,j;
scanf("%d",&n);
for(i=0;i<n;i++)
{
count=0;
scanf("%d",&x);
f(x,2);
printf("%d\n",count);
}
} | 1 |
192 | int times;
void fenjie(int m,int k)
{
int i;
{
for(i=k;i<=sqrt(m);i++)
{
if(m%i==0)
{
fenjie(m/i,i);
}
}
}
times++;
}
int main()
{
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
int m;
times=0;
scanf("%d",&m);
fenjie(m,2);
printf("%d\n",times);
}
} | 1 |
193 | int fj(int a, int b);
int main()
{
int n, i, a;
cin >> n;
for(i = 0; i < n; i++)
{
cin >> a;
cout << fj(a, 2) << endl;
}
return 0;
}
int fj(int a, int b)
{
int j, x, sum = 1, f = 0;
x = sqrt((double) a);
if((a == 1) || (a == 2) || (a == 3))
return 1;
else
{
for(j = b; j <= x; j++)
{
if(a % j == 0)
{
sum += fj(a / j, j);
f = 1;
}
}
if (f == 0)
return 1;
else
return sum;
}
} | 1 |
194 |
int is_bottom,max;
int div_foo(int n,int min);
int main(){
int N;
cin>>N;
for(int index=0;index<N;index++){
int k;
cin>>k;
is_bottom=0;
cout<<div_foo(k,2)+1<<endl;
}
return 0;
}
int div_foo(int n,int min){
int cal=0;
for(int iter=min;iter<=sqrt(n);iter++){
if(!(n%iter)){
cal++;
int f1=n/iter,f2=iter,g;
g=div_foo(f1,f2);
cal+=g;
}
}
return cal;
}
| 1 |
195 | int sum=0;
void recur(int N,int i)
{
if(N==1) sum++;
while(i<=N)
{
if(N%i==0)
recur(N/i,i);
i++;
}
return ;
}
int main()
{
int t=0;
cin>>t;
for(int k = 0; k < t; k++)
{
int n=0;
cin>>n;
int i=2,res=1;
for(int i =2; i <=n/2;i++)
{
if(n%i==0)
{
sum=0;
recur(n/i,i);
res+=sum;
}
}
cout<<res<<endl;
}
return 0;
}
| 1 |
196 |
int p(int a,int m)
{
int t=0;
int i;
if(a%m!=0)
return 0;
if((a%m==0)&&(a/m<m)&&(a!=m))
return 0;
if(a==m)
return 1;
if((a%m==0)&&(a/m>=m))
{
for(i=m;i<=a/m;i++)
{t=t+p(a/m,i);}
return t;
}
}
int main()
{ int n;
cin>>n;
int i;
int x;
int j;
int num=0;
for(i=0;i<n;i++)
{
cin>>x;
for(j=2;j<=x;j++)
{
num=num+p(x,j);
}
cout<<num<<endl;
num=0;
}
return 0;
}
| 1 |
197 | int total=0;
int divide(int k,int number)
{
if(number==1){total++;return 0;}
int i;
for(i=k;i<=number;i++)
{
if(number%i==0)
divide(i,number/i);
}return 0;
}
int main()
{
int i,n;
cin>>n;
int num[n];
for(i=0;i<n;i++)
cin>>num[i];
for(i=0;i<n;i++)
{total=0;
divide(2,num[i]);
cout<<total<<endl;
}
cin>>n;
return 0;
}
| 1 |
198 |
int digui(int m,int n,int sum)
{
int i;
sum++;
if(sqrt(m)<n)
return sum;
else{
for(i=n;i<=sqrt(m);i++){
if(m%i==0)
sum=digui(m/i,i,sum);
}
return sum;
}
}
void main()
{
int n,a;
scanf("%d",&n);
while(n--){
scanf("%d",&a);
printf("%d\n",digui(a,2,0));
}
} | 1 |
199 | int f(int x,int y)
{
int a,n=0;
for(a=y;a<=sqrt(x);a++)
{
if(x%a==0)
{
n++;
n+=f(x/a,a);
}
}
return n;
}
int main()
{
int m,i;
scanf("%d",&m);
int x[m],n[m];
for(i=0;i<m;i++)
{
scanf("%d",&x[i]);
n[i]=1+f(x[i],2);
}
for(i=0;i<m;i++)
{
printf("%d\n",n[i]);
}
return 0;
}
| 1 |