id
int32
0
32.5k
code
stringlengths
95
8.4k
label
stringclasses
65 values
200
int main() { int fenjie(int m,int i); int n,i,c[100]; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&c[i]); for(i=0;i<n;i++) printf("%d\n",fenjie(c[i],2)); return 0; } int fenjie(int m,int i) { int l = 1,j; int t = sqrt((float)m); for (j = i; j <= t; ++j) { if (m % j == 0) l += fenjie(m/j, j); } return l; }
1
201
int sum=0;//??????????? void fact(int a,int i)//?????;??????????a?????i????? { if(a==1) sum++;//???????N=1????????N????????1 while(i<=a)//????i???N { if(a%i==0) fact(a/i,i);//??N??i?????????????N/i?? i++;//??N???i???i?1 } } int main()//??? { int n;//????????? cin>>n;//?????? while(n--)//?? { int a;//?????????? cin>>a;//???? int i=2;//???????2? int result=1;//????????a?????? while(i<=a/2)//??i???a??? { if(a%i==0)//??i?a??? { sum=0;//sum?? fact(a/i,i);//????????/i result+=sum;//????????i???? } i++;//i?1 } cout<<result<<endl;//?????? } return 0; }
1
202
int f(int n, int min){ int i, result=1; if(min>n) return 0; for(i=min;i<n;i++){ if(n%i==0){ result+=f(n/i,i); } } return result; } int main(){ int n,a,i,t; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a); t=f(a,2); if(i<n-1) printf("%d\n",t); else printf("%d",t); } return 0; }
1
203
int all=1; //?????????????????????1 void divd(int,int); //?????????????????????????????? int main() { int n,num; cin>>n; while(n--) { cin>>num; divd(2,num); //????2??????? cout<<all<<endl; all=1; } return 0; } void divd(int fac,int num) { int i; for(i=fac;i*i<=num;i++) //??????????????????????????? if(num%i==0) //????????? { fac=i; //?? all++; //???? divd(fac,num/fac); //?????????? } }
1
204
int main() { int fun(int m,int n); int n,i,sum; scanf("%d",&n); int *p; p=(int *)malloc(sizeof(int)*n); for(i=0;i<n;i++) scanf("%d",&p[i]); for(i=0;i<n;i++) { sum=0; sum=fun(p[i],1); printf("%d\n",sum); } free(p); } int fun(int m,int n) { int i,sum=1; if(n==1) { for(i=2;i*i<=m;i++) { if(m%i==0) sum=sum+fun(m/i,i); } } else { for(i=n;i*i<=m;i++) { if(m%i==0) sum=sum+fun(m/i,i); } } return sum; }
1
205
void fun(int m, int i); //???? int num ; int main() { int n, i, a; cin>>n; for(i = 0; i < n; i++) { cin>>a; num = 0; fun(a, 2); //???? cout<<num + 1<<endl; //???????a=a???????num??1 } return 0; } void fun(int m, int i) { int k = sqrt(m); for(i = i; i <= k; i++) { if(m % i == 0) { num++; fun(m / i, i); //????????? } } }
1
206
int num=0; void f(int x,int y) { num++; for(int j=y;j*j<=x;j++) { if(x%j==0) f(x/j,j); } } int main() { int n; cin>>n; int a[1100]; for(int i=1;i<=n;i++) { num=0; cin>>a[i]; f(a[i],2); cout<<num<<endl; } return 0; }
1
207
int ge,s,w;//ge??????????? void fen(int h,int a);//fen???s?????????? int main() { int n=0,k=0;//n???????? k????????? s????????????? cin>>n; for(k=1;k<=n;k++) { cin>>s; ge=0; fen(s,2); cout<<ge<<endl; } return 0; } void fen(int h,int a) { for(int i=2;i<=h;i++) { if((h%i==0)&&(i>=a)) { if(h/i!=1) {fen(h/i,i);} else {ge++;} } } }
1
208
int factorization(int num, int i); int main() { int n, i, num; cin >> n; for (i = 0; i < n; i++) { cin >> num; cout << factorization(num, 2) << endl; } return 0; } int factorization(int num, int i) { int j, squ, sum = 1; squ = sqrt((double) num); for (j = i; j <= squ; j++) { if (num % j == 0) sum = sum + factorization(num / j, j); } return sum; };
1
209
int sum; void f(int x,int min) { int p; if (x==1) sum++; else for (p=min;p<=x;p++) if (x%p==0) f(x/p,p); } int main() { int n,i,j,k; cin>>n; for (i=1;i<=n;i++) {sum=0; cin>>k; for (j=2;j<=k;j++) if (k%j==0) f(k/j,j); cout<<sum<<endl; } return 0; }
1
210
int im(int n,int max) { int s=0,i; if(n==1) return 1; for(i=max;i>1;i--) if(n%i==0) s+=im(n/i,i); return s; } int main() { int i,n,t; scanf("%d%d",&n,&t); printf("%d",im(t,t)); for(i=1;i<n;i++) { scanf("%d",&t); printf("\n%d",im(t,t)); } //getch(); return 0; }
1
211
int sum = 0; void fenjie(int t,int n) { int i = 0; if(n == 1) sum++; for(i = t; i <= n; i++) { if(n % i == 0) { fenjie(i, n / i); } } } int main() { int n = 0, k = 0; cin >> n; while(n > 0) { cin >> k; sum = 0; fenjie(2,k); n--; cout << sum <<endl; } return 0; }
1
212
int t; int f(int a,int b){ int i; for(i=a;i*i<=b;i++){ if(b%i==0){ t++; f(i,b/i); } } return t; } void main() { int n,i,result[1000],a[1000]; scanf("%d",&n); for(i=0;i<n;i++){ t=1; scanf("%d",&a[i]); result[i]=f(2,a[i]); } for(i=0;i<n;i++) printf("%d\n",result[i]); }
1
213
int breakways(int num, int min); int main() { int n; cin >> n; int number; for (int i = 1; i <= n ; i++) { cin >> number; cout << breakways(number , 2) << endl; } } int breakways(int num, int min) { int sum = 0; for (int j = min ;j <= num ; j++) { if (num % j == 0) { if (num != j) sum += breakways (num / j , j); else sum += 1; } } return sum; }
1
214
int times; int move(int a,int num)//a?????? {int i; if(num==1) times++; for(i=2;i<=num;i++) if(num%i==0&&i>=a) move(i,num/i); return times; } int main() { int n,i; cin>>n; int a[n]; for(i=0;i<n;i++) cin>>a[i]; int b[n];//?????? for(i=0;i<n;i++) {times=0; b[i]=move(1,a[i]);} for(i=0;i<n;i++) cout<<b[i]<<endl; return 0; }
1
215
void decprime(int begain,int a); int sum=1; int main() { int n,a; int k;cin>>n; for(k=0;k<n;k++){ cin>>a; decprime(2,a) ; cout<<sum<<endl; sum=1; } return 0; } void decprime(int begain,int a) { int i; //int u=int(sqrt(double(a))); //int m[10000]={}; //if(a==2||a==3||a==5)return 1; //else{ for(i=begain;i<=a;i++){ if(a%i==0&&i<=a/i) { sum++; decprime(i,a/i); } if(i>a/i)break; //m[i]=decprime(a/i); //else m[i]=0; //sum+=m[i]; //} //return sum+1; } }
1
216
int f(int n,int min){ int i,result=1; if(n<min)return 0; for(i=min;i<n;i++) if(n%i==0)result+=f(n/i,i); return result; } void main() { int cases,a; scanf("%d",&cases); while(cases--){ scanf("%d",&a); printf("%d\n",f(a,2)); } }
1
217
/* * ????.cpp * Created on: 2012-11-19 * Author:??? */ int f(int a,int b){//?a???????b????????? int num=1,i; for(i=b;i<=sqrt(a);i++){//??b?a???????????a? if(a%i==0)num+=f(a/i,i);//????a??????????a??????????i?????? } return num;//???? } int main(){ int i,n,a; cin>>n;//??????? for(i=1;i<=n;i++){ cin>>a; cout<<f(a,2)<<endl;//??????? } return 0; }
1
218
main() { int find(int m,int k); int n,y,d,c; scanf("%d",&c); for(d=0;d<c;d++) { scanf("%d",&n); y=find(n,1) ; printf("%d\n",y); } } int find(int m,int k) { int i,t=1,n=0,x=0,a,s=0; for(i=2;i<=m;i++) { if(m%i==0)n++; } if(n==1||m==1)return 1; else { for(i=2;i<=m;i++) { if(m%i==0&&m/i>=i&&i>=k) { k=i; t=t+find(m/i,k); } } } return t; }
1
219
int Factorization(int n,int k){ //???????? int sum=0; //??????sum?????????? if (n<k){ //?????????k return 0; //??0 } if (n%k==0){ //????????k??? if (n==k){ //?n?k??? return 1; //??1 } else{ sum=sum+Factorization(n,k+1)+Factorization(n/k,k); //?????????? } } else{ sum=sum+Factorization(n,k+1); //?????????k???????? } return sum; //??sum?? } int main(){ int t,i,a; //???????t???????i??????a??????? cin>>t; //???????? for (i=1;i<=t;i++){ //????????? cin>>a; cout<<Factorization(a,2)<<endl; } return 0; }
1
220
/** * author:liucheng * date:2010-10-23 13:04:16 * file:factors.cpp */ int factor(int num,int minA1) { int count=0; int sqrtNum; int i; if(num <= minA1) return 0; sqrtNum=(int)sqrt((double)num); for(i=minA1;i<=sqrtNum;i++) if(num % i == 0) { count++;//num=i*(num/i) count+=factor(num/i,i);//num=i*(factor(num/i)) } return count; } int main() { int n; int num; cin>>n; while(n -- ) { cin>>num; cout<<factor(num,2)+1<<endl; } return 0; }
1
221
void factor(int x,int limit); int result; int main() { int n; scanf("%d",&n); int input; for(int i=0;i<=n-1;i++) { scanf("%d",&input); result=1;//limit?2?????result=1; factor(input,2);//limit?2?????result=1; printf("%d\n",result); } return 0; } void factor(int x,int limit) { int remainder; if(x<limit) { return; } for(int i=limit;i<=x;i++) { remainder=x%i; if(remainder==0) { if(x/i>=i) { result++; factor(x/i,i); } } } }
1
222
void factor(int a, int k); int sum = 0; int main() { int n, a, i = 0; cin >> n; for (i = 1; i <= n; i++) { cin >> a; factor(a, 2); cout << sum + 1 << endl; sum = 0; } return 0; } void factor(int a, int k) { int b, j; b = (int)sqrt((double)a); for (j = k; j <= b; j++) { if (a % j == 0) { sum++; factor(a / j, j); } } j = k; }
1
223
int qipa(int p,int q) // ?p???????????q?????? { int i,l,s=0; if(p==1) return 1; for(i=p;i>1;i--) if(p%i==0 && i<=q) s+=qipa(p/i,i); return s; } int main() { int i,j,n,m,t; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&m); t=qipa(m,m); printf("%d\n",t); } return 0; }
1
224
int t;//t??? void f(int n,int d)//n?????d??? { int i; if(n==1)// t++; else { for(i=d;i<=n;i++) { if(n%i==0) { f(n/i,i); } } } } int main() { int number[100]; int n,i; int result[100]; cin>>n; for(i=0;i<n;i++) { cin>>number[i]; } for(i=0;i<n;i++) { t=0; f(number[i],2); result[i]=t; } for(i=0;i<n;i++) { cout<<result[i]<<endl; } return 0; }
1
225
//???????? //?????? int f(int a,int m) //???a???????m????????? { if(a<m) return 0; int kind=1; for(int i=m;i<a;i++) { if(a%i==0) //?????????????? kind=kind+f(a/i,i); } return kind; } int main() { int n,a[100]; cin>>n; for(int i=0;i<n;i++) //??n??? cin>>a[i]; for(int i=0;i<n;i++) cout<<f(a[i],2)<<endl; //???? return 0; }
1
226
int f(int m,int min); int main() { int n,m,i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&m); printf("%d\n",f(m,2)); } return 0; } int f(int m,int min) { int count=1,i; if(m==1) return 1; else if(m == 2) return 1; else { for(i=min;i<=sqrt(m);i++) { if(m%i==0) { count += f(m/i,i); } } return count; } }
1
227
int tot; void find(int m,int n) { int i,j,k; if (m==1) tot=tot+1; else { for (i=n;i<=m;i++) if(m%i==0) find (m/i,i); } } int main() { int i,j,k,m,n; cin >>n; for (i=1;i<=n;i++) { tot=0; cin >>m; find(m,2); cout <<tot<<endl; } cin >>n; return 0; }
1
228
/* * fenjie.cpp * * Created on: 2010-11-28 * Author: ??? * function: ???? */ int solutionNumber(int a,int k){//?????????????? int i; if(a==1) return 1; if(k>a) return 0; for(i=k;i<=a;i++) if(a%i==0) return solutionNumber(a,i+1)+solutionNumber(a/i,i); } int main() { int n,a[101]; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i];//?????? cout<<solutionNumber(a[i],2)<<endl;//???????????? } return 0; }
1
229
int p=0; int factor(int a,int min) { int sum=0; if(min>=a)return 1; for(int j=min;j<=a/min;j++) if (a%j==0) sum+=factor(a/j,j); return sum; } int main() { int n=0,a=0; cin>>n; while(n>0) { cin>>a; if(a<=2) cout<<1<<endl; else cout<<factor(a,2)+1<<endl; n--; } return 0; }
1
230
/* * 009.cpp * * Created on: 2012-11-27 * Author: asus */ int varieties = 0;//?????? void divide(int forward, int number)//??divide?? { int i; if (number == 1)//???? { varieties++;//?? } for (i = forward; i <= number; i++)//forward???????,number?????,?forward????? { if (number % i == 0)//???? { divide(i, number / i); }}} int main()//??? { int n = 0, num = 0; cin >> n;//???? for (int i = 1; i <= n; i ++) {cin >> num; divide(2, num);//?? cout << varieties << endl; varieties = 0; } return 0; }
1
231
int zhi(int a); int yin(int m,int t); int main() { int n,i=0; int str[10000]; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&str[i]); i=0; for(i=0;i<n;i++) printf("%d\n",yin(str[i],2)); return 0; } int zhi(int a) { int k=2,flag=0; for(k=2;k<=a/2;k++) { if(a%k==0) { flag=1; break; } } return flag; } int yin(int m,int t) { int j=t,c=0,b=0,x=0; int str1[10000][2]; if(m<t&&m!=1) return 0; else if(m==1) return 1; else if(zhi(m)==0) return 1; else for(j=t;j<=m;j++) { if(m%j==0) { str1[c][0]=m/j; str1[c][1]=j; c++; } } for(b=0;b<c;b++) { x+=yin(str1[b][0],str1[b][1]); } return x; }
1
232
int Divide(int a,int b); int main() { int Times=0; int Num=0; int i=0; int Temp[100]={0}; cin>>Times; for (i=0;i<Times;i++) { cin>>Num; Temp[i]=Divide(Num,Num); } for (i=0;i<Times;i++) {cout<<Temp[i]<<endl;} return 0; } int Divide(int a,int b) { int Sum=0; int i=0; int Flag=0; if (a!=1) { for (i=b;i>1;i--) {if (a%i==0) Sum+=Divide(a/i,i); Flag=1; } } if (Flag==0||a==1) {Sum=1;} return Sum; }
1
233
int main() { int digui(int p,int q); int n,i,j; scanf("%d",&n); for(i=0;i<n;i++) { int a,sum=1; scanf("%d",&a); for(j=2;j<a;j++) {if(j*j>a) break; else if(a%j==0) sum=sum+digui(j,a/j); } printf("%d\n",sum); } } int digui(int p,int q) { int z=1,d; if(p==q) z=1; else if(p>q) z=0; else for(d=p;d<q;d++) {if(d*d>q) break; else if(q%d==0) z=z+digui(d,q/d); } return(z); }
1
234
int fen(int x,int y); int main(){ int n,i,m[500]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&m[i]); printf("%d\n",fen(m[i],2)); } return 0; } int fen(int x,int y){ int j,k; int result=1; if(x<y) return 0; for(j=y;j<x;j++) { if(x%j==0) result+=fen(x/j,j); } return result; }
1
235
int sum(int a,int i) { int ret=1; for(;i<=sqrt((float)a);i++) { if(a%i==0) { ret+=sum(a/i,i); } } return ret; } int main() { int t,a,j; cin>>t; for(j=0;j<t;j++) { cin>>a; cout<<sum(a,2)<<endl; } return 0; }
1
236
int main() { int f(int k,int m); int n; scanf("%d",&n); int i; for(i=1;i<=n;i++) { int k; scanf("%d",&k); printf("%d\n",f(k,2)); } return 0; } int f(int k,int m) { int i; int j=0; if(k<=m) { if(k==m){ j=1; return j; } else { j=0; return j; } } else { for(i=m;i<=k;i++) { if(k%i==0&&k/i!=1) j=j+f(k/i,i); if(k%i==0&&k/i==1) j=j+1; } return j; } }
1
237
int num =0; void fenjie(int n,int x) { extern int num; if ( n == 1) num ++; else for(int i = x; i<=n;i++) if(n % i == 0) fenjie(n/i,i); } int main() { int n,k; cin >> k; for(int j = 0;j!= k;j++) {extern int num; num =0; cin >> n; fenjie(n,2); cout<<num<<endl; } return 0; }
1
238
//*************************************************** //1.cpp ???? ****** //?? ??? 1200018209 ******** //?? 2012-11-27 ****** //*************************************************** int dispose(int , int); int main() { int n,i,p; cin >> n; for(i=0;i<n;i++) { cin >> p; cout << dispose(p,2) << endl; } return 0; } int dispose(int p,int y) { int i,sol=1; //?????sol?????? for(i=y ; i<=(int)(sqrt(p)) ; i++) { if(p%i==0) { sol += dispose(p/i,i); //??????return???????????????? } } return sol; }
1
239
int s; void search(int a,int k) { if(a==0) return ; if(a==1) { return; } for(int i=2;i<a;i++) { if(a%i==0&&a/i>=i&&i>=k&&a/i>=k) { s++; search(a/i,i); } } return ; } int main() { int n,a; cin>>n; for(int i=0;i<n;i++) { s=1; cin>>a; search(a,1); cout<<s<<endl; } return 0; }
1
240
int cut(int m,int l){ int sum=1; for(int i=l;i<=sqrt((double)m/l);i++){ if((m/l)%i==0){ sum+=cut(m/l,i); } } return sum; } int main (){ int n; cin>>n; for(int i=0;i<n;i++){ int t=0; cin>>t; cout<<cut(2*t,2); if(i<n-1) cout<<endl; } }
1
241
int yinshu(int be,int by)//??????? { int i,sum=0; for(i=by;i*i<=be;i++) { if(be%i==0) { sum=sum+1+yinshu(be/i,i); }//be?i?????????????????be/i } return sum; } int main() { int n; cin>>n;//?? while(n--)//??? { int num,sign;//sign?????? cin>>num; for(int j=num;j>1;j--) { if(num%j==0) sign=j; }//?????? cout<<yinshu(num,sign)+1<<endl;//???? } return 0; }
1
242
int multiply(int a,int b) { int i=0,n=0,sum=1; if(a<b) return 0; else { for(i=b;i<=a;i++) //???? { if(a%i==0) { sum=sum+multiply(a/i,i); //???? } } return sum; } } int main() { int n=0,m=0,i=0,sum=0,num,result[1000]; cin>>n; do //????? { cin>>num; result[i]=multiply(num,2); //???? i=i+1; m=m+1; }while(m<n); for(i=0;i<n;i++)//???? { cout<<result[i]<<endl; } return 0; }
1
243
int countt; void f(int p,int q) { for(int m=p;m<=sqrt(q);m++) { if(q%m==0) {countt++; f(m,q/m);} } } int main() { int n,num,i; cin>>n; for(i=0;i<n;i++) { cin>>num; countt=0; for(int k=2;k<=sqrt(num);k++) { if(num%k==0) { countt++; f(k,num/k); } } cout<<countt+1<<endl;; } return 0; }
1
244
/* * [email protected] * * Created on: 2011-11-27 * Author: Administrator */ int num0;//???? int factor(int x, int y)//????? { int countn = 1;//????????1 if ( x == 1 ) return 0; if ( x == 2 ) return 1;//??1,2????? for ( int i = y; i <= sqrt(x); i ++) if ( x % i == 0 ) countn += factor(x / i, i);//????? return countn; } int main()//????? {//????? int n, j;//???? cin >> n;//???? for ( j = 1; j <= n; j++) { cin >> num0;//??????? cout << factor(num0, 2) << endl;//?????? } return 0;//??????????????????? }//????
1
245
int devide(int n,int k) { int s,i; s=1; for(i=k;i<=sqrt(n*1.0);i++) { if(n%i==0) { s=s+devide(n/i,i); } } return s; } int main() { int n,a[200],i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); if(i==0)printf("%d",devide(a[i],2)); else printf("\n%d",devide(a[i],2)); } return 0; }
1
246
int f(int a,int min)//???a???????min????????? { int i; 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; } int main() { int n,a;//???? cin>>n; while(cin>>a)//???? { cout<<f(a,2)<<endl;//???? } return 0; }
1
247
int f(int m,int l) { int re=0,j; if(l==4) re=1; if(l>4) { for(j=m;j<=sqrt(l);j++) { if(l%j==0) { re=re+1+f(j,l/j); } } } return re; } int main() { int n,i,a[100]={0}; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { printf("%d\n",(f(2,a[i])+1)); } }
1
248
int num(int b,int min); int x=1,m; int main() { int a,n,b; scanf("%d",&n); for(a=0;a<=n-1;a++) { scanf("%d",&b); m=b; b=num(b,2); printf("%d\n",b); x=1; } return 0; } int num(int b,int min) { int a,c; for(a=min;a<b;a++) { if((b%a==0)&&(b/a>=a)) { if(num(b/a,a)==1) { x++; } } if(a==m-1) return x; } return 1; }
1
249
int a,n,sum=0; void t(int m) { int i,j; for(i=m;i<=a;i++) { if(a%i==0) { a=a/i; if(a==1) { sum+=1; } else t(i); a=a*i; } } } int main() { int k; cin >> n; for(k=0;k<n;k++) { sum=0; cin >> a; t(2); cout << sum << endl; } return 0; }
1
250
int tru(int c) { int j,p=0; if(c==1||c==2) return 1; else for(j=2;j<=pow((double)c,0.5);j++) if(c%j==0) { p=1; break; } if(p==1) return 0; else return 1; } int count(int a,int b) { int i,k=1; if(!tru(a)) for(i=b;i<=pow((double)a,0.5);i++) if(a%i==0) k=k+count(a/i,i); return k; } int main() { int n,x[999],q; scanf("%d",&n); for(q=0;q<n;q++) scanf("%d",&x[q]); for(q=0;q<n;q++) printf("%d\n",count(x[q],2)); return 0; }
1
251
int make(int x,int t) { int ans=0,i; if (x==1) return 1; for (i=t;i<=x;i++) if (x%i==0) ans+=make(x/i,i); return ans; } int main() { int i,k,j,p,n,t,m,x; scanf("%d",&t); for (p=1;p<=t;p++) { scanf("%d",&n); x=make(n,2); printf("%d\n",x); } }
1
252
int s(int, int); int main() { int n, i, a; cin >> n; for(i = 0;i < n;i++) { cin >> a; cout << s(a, 2) << endl; // ??????b????2 } return 0; } int s(int a, int b) { int i, t = 0; for(i = b;i < a;i++) if(a % i == 0 && a / i >= i) // ???????????????? t = t + s(a / i, i); // ???????????? return t + 1; }
1
253
/* * 1000012850_34.1.cpp * ????????????a??????????????? ????????? * Created on: 2010-11-27 * Author: william */ int resolution_into_factors(int j,int i) { int m, sum=0, k=0; for(m=j ;m<=sqrt(i); m++) { if(i%m==0) { sum=resolution_into_factors(m, i/m)+sum+1; k++; } } if(k==0) return 0; return sum; } int main() { int n, k, i; cin>>n; for(k=1; k<=n; k++) { cin>>i; cout<<resolution_into_factors(2,i)+1<<endl; } return 0; }
1
254
int num; void f(int n,int i); main () { int i,j,k,n,order,top; for (scanf("%d",&order);order>=1;order--) { scanf("%d",&n); num=0; top=(int)sqrt(n); for (i=1;i<=top;i++) { if (n%i==0) { num++; //printf("n=%d i=%d top=%d\n",n,i,top); f(n/i,i); } } printf("%d\n",num); } } void f(int n,int btm) { if (btm==1) return; int top,i; top=(int)sqrt(n); //printf("f:n=%d i=%d top=%d\n",n,i,top); if (top>=btm) { for (i=btm;i<=top;i++) { //printf("f:n=%d i=%d top=%d\n",n,i,top); if (n%i==0) { num++; f(n/i,i); } } } }
1
255
int sum=1 ; int kk(int a,int b) { int i; for(i=b;i>=2;i--) if(a%i==0) return a/i; return 0; } int seperate(int a,int b) { int i; for(i=b;i>=2;i--) { if(a%i==0&&(a/i)<=i) {sum++;if((a/i)==2)continue;else seperate(a/i,a/i-1);} else if((a%i==0)&&((kk(a/i,i))!=0)) { seperate(a/i,i); } } return sum; } int main() { int n,i,m; cin>>n; for(i=1;i<=n;i++) { cin>>m; cout<<seperate(m,m-1)<<endl; sum=1; } return 0; }
1
256
/**************************************** * ???? * * * * Created on: 2010-12-8 * * Author:?? * ***************************************/ int factor(int x,int y) //?????????factor { int i; for(i=2;i<x;i++) //?????x????? { if(x%i==0) { break; } } if(i==x) { return 1; //??x??????1 } else //???????????? { int sum=0; if(x==y) //?x?y?????y/x+1??????????????????????1??? { for(i=y/x+1;i<=sqrt(x);i++) //????????????????? { if(x%i==0) { sum=sum+factor(x/i,x); } else continue; } return sum+1; //????sum+1?????????a=a??? } else { //?x?y??????y/x????????? for(i=y/x;i<=sqrt(x);i++) { if(x%i==0) { sum=sum+factor(x/i,x); } else continue; } return sum+1; //????sum+1?????????a=a??? } } } int main() //????? { int n; cin>>n; const int m=n; int a[m],j; for(j=0;j<n;j++) { cin>>a[j]; //??????? } for(j=0;j<n;j++) { cout<<factor(a[j],a[j])<<endl; //?????? } return 0; }
1
257
int fun(int m,int n) { int i,sum=1; if(n==1) { for(i=2;i*i<=m;i++) { if(m%i==0) sum+=fun(m/i,i); } } else for(i=n;i*i<=m;i++) { if(m%i==0) { sum+=fun(m/i,i); } } return sum; } int main() { int n,i,b; int a[1000]; cin>>n; for(i=0;i<n;i++) { cin>>b; a[i]=fun(b,1); } for(i=0;i<n;i++) cout<<a[i]<<endl; }
1
258
int yinshu[10000]; int j=0; int temp=0; int main() { void fenjie(int j,int sum); int t,n[10000],i; cin>>t; for(i=0;i<10000;i++) { yinshu[i]=0; } for(i=0;i<t;i++) { cin>>n[i]; } for(i=0;i<t;i++) { fenjie(1,n[i]); cout<<temp<<endl; temp=0; } return 0; } void fenjie(int j,int sum) { for(int i=2;i<=sum;i++) { if(sum%i==0&&yinshu[j-1]<=i) { yinshu[j]=i; if(sum==i) { temp++; } else { fenjie(j+1,sum/i); } } } }
1
259
int prime(int min,int num) { int i; for(i=min;i<num;i++) { if(num%i==0) return 0; } return 1; } int count(int min,int num) { int i=0,n=1; if(prime(min,num)) return 1; else for(i=min;i<num;i++) { if(num%i==0&&i<=num/i) { n=n+count(i,num/i); } } return n; } int main() { int num,n,i; cin>>n; for(i=0;i<n;i++) { cin>>num; cout<<count(2,num)<<endl; } return 0; }
1
260
int fjys(int x,int y) { if(x<y) return 0; int i,n=1; for(i=y;i<x;i++) { if(x%i==0) { n+=fjys(x/i,i); } } return n; } int main() { int n,a[100]; cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; cout<<fjys(a[i],2)<<endl; } return 0; }
1
261
int s=0,z=2;//?????? z?? ??????? void number(int x,int y) { //???? int i; if(x==1) { s=s+1; }//????1? ???? s+1 for(i=y;i<=x;i++) { if(x%i==0) { number(x/i , i); }//?????? } } int main() { int n,a,i; cin>>n; for(i=1;i<=n;i++) { cin>>a; number(a,z); cout<<s<<endl;//???? s=0;//S?0 } }
1
262
int c = 1; void fenjie(int a, int k) { if (a == 1) { c++; return; } for (int i = k; i <= a; i++) { if (a % i == 0) { fenjie(a / i, i); } } } int main() { int n, a; cin >> n; while (n--) { c = 0; cin >> a; fenjie(a, 2); cout << c << endl; } return 0; }
1
263
int fun(int i,int j,int count) { int k; for (k=i;k<=sqrt(j);k++) if(j%k==0) { count++; count=fun(k,j/k,count); } return count; } int main() {int count; int k,n,i,j; scanf("%d",&k); for(j=0;j<k;j++) { scanf("%d",&n); count=1; for(i=2;i<sqrt(n);i++) if(n%i==0) { count++; count=fun(i,n/i,count); } printf("%d\n",count); } return 0; }
1
264
int num=0; void f(int k,int n) { int i,flag=0; for(i=k;i<=n;i++) { if(n%i==0) { f(i,n/i); flag=1; } } if((flag==0&&k<=n)||n==1) num++; } int main() { int i,n,m; cin>>m; for(i=1;i<=m;i++) { cin>> n; f(2,n); cout<<num<<endl; num=0; } return 0; }
1
265
int panduansushu(int t) { int i; for(i=2;i<t;i++) { if(t%i==0){break;} } if(i>t/2)return 1; else return 0; } int sum=0; void fun(int n,int i) { if(n==1)sum++; for(;i<=n;i++) { if(n%i==0)fun(n/i,i); } } void main() { int a[100],i,res,j,n; scanf("%d",&n); for(j=0;j<n;j++)scanf("%d",&a[j]); for(j=0;j<n;j++) { if(panduansushu(a[j])==1) { printf("1\n"); } else{ for(i=2,res=1;i<a[j]/2;i++) { if(a[j]%i==0){sum=0;fun(a[j]/i,i);res+=sum;} } printf("%d\n",res);}} }
1
266
int t; int main() {int n,i,a[100]; void fenjie(int x,int y); scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); for(i=0;i<n;i++) {t=0; fenjie(2,a[i]); printf("%d\n",t); } return 0; } void fenjie(int x,int y) {int j; if(y==1){ t++; return;} for(j=x;j<=y;j++) {if(y%j==0) fenjie(j,y/j); } }
1
267
int f(int a,int min);//???a???????min????????? int f(int a,int min) { if(a < min){ return 0; } int result = 1; for(int i = min;i*i<=a;i++){ if(a % i == 0){ result += f(a/i,i);//???? ??????????a/i?i????????i??????? } } return result; } int main(){ int n,k; cin>>n; while(n>0) { cin>>k; cout<<f(k,2)<<endl;//???? n--; } }
1
268
int a; int m=0,s=1; void temp(int b,int k,int c) { for(int i=k;i<=b;i++)//???? { if(b%i==0) { b=b/i; s=s*i; k=i; if(s==c) { m++; } else temp(b,k,c); s=s/i;//?? b=b*i; } } } int main() { int n,a,i; cin>>n; for(i=0;i<n;i++) { cin>>a; temp(a,2,a);//?? cout<<m<<endl; m=0; } return 0; }
1
269
int calculate(int a, int num) { // a is the max num int sum = 0; if(num == 1) return 1; for(int i = num; i >= 2; i--) { if(num % i == 0 && i <= a) { sum += calculate(i, num / i); } } return sum; } int main () { int n; cin >> n; int num = 0; for(int i = 0; i < n; i++) { // input part cin >> num; cout << calculate(num, num) << endl; } return 0; }
1
270
/* * ????.cpp * * Created on: 2012-11-30 * Author: ?? */ int f(int min,int a) //????????????????min???????a???? { if(min>a) return 0; //???????a???????????????0 int i;int num=1; //??????i????num???a=a????????1 for(i=min;i<=sqrt(a);i++)//i?min????????????????? { if(a%i==0) //??a?i?? { num = num + f(i,a/i);//????a/i?min?i?????? } } return num; //????num } int main() //????? { int m,a,j; //m????????a???????j???? cin>>m; //??m for(j=0;j<m;j++) //?m?? { cin>>a; //??????? cout<<f(2,a)<<endl; //??????? } return 0; //??????????? }
1
271
int x[1000]={0}; void f(int m,int n,int l) { int i; for(i=m;i<=n;i++) { if(n%i!=0) continue; else { if(n/i==1) { x[l]++; return; } else f(i,n/i,l); } } } int main() { int a[1000],s,j,sum; cin>>sum; for(j=1;j<=sum;j++) { cin>>a[j]; s=2; f(s,a[j],j); } for(j=1;j<=sum;j++) { cout<<x[j]<<endl; } return 0; }
1
272
int a[1000]; int l=0,x; int fff(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(q-1,1,x); printf("%d\n",l,x); } } int fff(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(w,i,x); x=x*a[i]; } } }
1
273
void main() { int f(int ,int ); int n[100],sum,i,m; scanf("%d",&m); for(i=0;i<m;i++) scanf("%d",&n[i]); for(i=0;i<m;i++) { sum=f(1,n[i])+1; printf("%d\n",sum); } } int f(int i,int n) { int j,k,sum=0; for(j=i;j<(int)sqrt((double)n)+1;j++) { k=sum; if(j==1)sum=0; else { if(n%j==0&&n/j>=j) { sum=f(j,n/j)+1; } else sum=0; } sum=sum+k; } return(sum); }
1
274
int sum; void zhongshu(int qian,int a); int main() { int n,i,j,a[100]; cin>>n; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<n;i++) { sum=0; zhongshu(2,a[i]); cout<<sum<<endl; } return 0; } void zhongshu(int qian,int a) { int i,j,c; if(a==1) { sum=sum+1; return; } for(i=qian;i<=a;i++) { if(a%i==0) zhongshu(i,a/i); } }
1
275
int min(int a,int b) { if(a>=b) return b; else return a; } int f(int a,int b) { int count=0; int k[32768]={0}; if(a==1) return 1; else { int i,j; for(i=min(a,b);i>=2;i--) { if(a%i==0) k[i]=i; } for(j=0;j<32768;j++) { if(k[j]!=0) { count=count+f(a/k[j],j); k[j]=0; } } return count; } } main() { int n,i,a,number; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a); number=f(a,a); printf("%d\n",number); } }
1
276
int f(int a,int b); int main() { int n,c[100],i,a,sum; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&c[i]); } for(i=1;i<=n;i++) { a=c[i]; sum=f(a,2); printf("%d\n",sum); } return 0; } int f(int a,int b) { int sum=1; int i; if(a<b) return 0; for(i=b;i<a;i++) { if(a%i!=0) continue; else sum=sum+f(a/i,i); } return sum; }
1
277
/* * ????apple.cpp * ???00948343_?? * ?????2012/11/19 * ??????? */ int fenjie(int a, int start); int main(){ int n, i, integ; cin >> n; for (i=0;i<n;i++){ cin >> integ; cout << fenjie(integ, 2) << endl; } return 0; } int fenjie(int a, int start){ int i, sum=1; if (start==a) sum=1; else{ for (i=start;i<=sqrt(a);i++){ if (a%i==0){ sum = sum + fenjie(a/i, i); } } } return sum; }
1
278
//************************************************************************* //*????????? ***************************************************** //*??????? 1200012979 ********************************************** //*???2012.11.27 ******************************************************* //************************************************************************* void breakup(int, int); int sum; int main () { int n, x, count=0; cin >> n ; //?????? while( count < n ) { sum = 0 ; count++ ; //????? cin >> x ; //?????? if(x > 3) breakup(x, 2); //???? cout << sum+1 << endl; //??????????? } return 0; } void breakup( int x, int j ) { int i, p, m; m = x; //??????? p = sqrt( (double)x ) ; //p?????????? for( i = j ; i <= p ; i++ ) if (m % i == 0 ) //???????????????? { sum++ ; //?????? x = m / i ; breakup(x, i) ; } return ; }
1
279
int t,m,n,i,j,k,xx,x1,x2,x,y,s,n0; void init(int a[],int b[]) { freopen("tt.in","r",stdin); scanf("%d%d",&m,&n); for (i=1;i<=m;i++) scanf("%d",&a[i]); for (i=1;i<=n;i++) scanf("%d",&b[i]); } void output(int a[],int k) { int i; freopen("tt.out","w",stdout); for(i=1;i<=k;i++) if (i==1) printf("%d",a[i]); else printf(" %d",a[i]); } void proce(int n,int b) { int i; if (n==1) s++; else for (i=b;i<=n0;i++) if (!(n%i)) proce(n/i,i); } int main() { //freopen("tt.in","r",stdin); //freopen("tt.out","w",stdout); scanf("%d",&n); for (i=1; i<=n;i++) { scanf("%d",&x); s=0; n0=x; proce(x,2); printf("%d\n",s); } return 0; }
1
280
int main() { int func(int a,int b); int n; cin>>n; while(n--){ int number; cin>>number; cout<<func(number,number)<<endl; } return 0; } int func(int a,int b) { if(a==1){ return 1; } if(b==1){ return 0; } if(a%b==0){ return func(a/b,b)+func(a,b-1); } return func(a,b-1); }
1
281
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; } int main(){ int n,m,j,re; scanf("%d",&n); for(j=0;j<n;j++){ scanf("%d",&m); re=factor(m,2); printf("%d\n",re); } scanf("%d",&n); return 0; }
1
282
int sum=0; void f(int n,int i) { if(n==1) sum++; while(i<=n) { if(n%i==0) f(n/i,i); i++; } return ; } int main() { int t=0; cin>>t; while(t--) { int n=0; cin>>n; int i=2,result=1; for (i=2;i<=n/2;i++) { if(n%i==0) { sum=0; f(n/i,i); result=result+sum; } } cout<<result<<endl; } return 0; }
1
283
int main() { int depart (int number, int y); int i, n, number; cin >> n; for (i = 1; i <= n; i++) { cin >> number; cout << depart (number, 2) << endl; } return 0; } int depart (int number, int y) { int count = 1, a, i; if (number == 1) return 0; if (number == 2) return 1; else a = sqrt( number); for (i = y; i <= a; i++) if (number % i == 0) count += depart (number / i, i); return count; }
1
284
int f(int x,int y) //???????????????y?????????x???????? { int i,sum = 0; for(i = x; i <= sqrt(y); i++){ if(y % i == 0) sum += f(i,y / i) + 1;} //?????? return sum; } int main(){ int n,x,i,b[100]; cin>>n; //????????? for(i=1;i<=n;i++){cin>>x;b[i]=x;} for(i=1;i<=n;i++){cout<<f(2,b[i])+1<<endl;} //??????? return 0; }
1
285
int fenjie(int num,int min); int k=2; int main(){ int n,i,jieguo,num; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",&num); jieguo=fenjie(num,2); printf("%d\n",jieguo); } return 0; } int fenjie(int num,int min){ int j,jieguo=1; if(num<min){ return 0; } for(j=min;j<num;j++){ if(num%j==0){ jieguo+=fenjie(num/j,j); } } return jieguo; }
1
286
int number(int m,int x) { int a,b,c,n,l,k,r; k=(int)sqrt(m); if(x>m) { return 0; } else if(x>k) { return 1; } else { l=1; for(a=x;a<=k;a++) if(m%a==0) l=l+number(m/a,a); else; return l; } } main() { int n,a; scanf("%d",&n); for(a=1;a<=n;a++) { int m,b; scanf("%d",&m); b=number(m,2); printf("%d\n",b); } }
1
287
void main() { int n,a[100],i; void fen(int a[],int x); scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } fen(a,n); } void fen(int a[],int x) { int k,b=2,c,t; int look(int x,int y); for(k=0;k<x;k++) { c=a[k]; t=look(c,b); printf("%d\n",t); } } int look(int x,int y) { int total=1,p; if(x/y==0) { return 0;} else { for(p=y;p<x;p++) { if(x%p==0) { total=total+look(x/p,p); } } } return total; }
1
288
int cal(int,int); int main () { //???? int n=0; cin>>n; //?????? for (int i=0;i<n;i++) { int m=0; cin>>m; //?2?????????????? cout<<cal(m,2)<<endl; } return 0; } //???????1??????????2????????? int cal (int m,int i) { int count=0; if (m==1) return 1;//???1?????????1??? for (i;i<=m;i++)//??i????????????? { if (m%i==0) { count+=cal(m/i,i); } } //????? return count; }
1
289
int m,n,num; void dfs(int i,int j) { int x; if (i==1) { num++; return; } for (x=j;x<=i;x++) if (i%x==0) dfs(i/x,x); } int main() { cin>>m; while(m>0){ num=0; cin>>n; dfs(n,2); cout<<num<<endl; m--; } }
1
290
int f(int m, int n) { int i, count = 0, flag = 0; if (m == 1) return 1; for (i = n; i > 1 ; i--) { if (m % i == 0) { count += f(m / i, i); flag = 1; } } if (flag) return count; else return 0; } int main() { int n, k, m, temp; cin >> n; for (k = 0; k < n; k++) { cin >> m; cout << f(m, m) << endl; } return 0; }
1
291
int check(int i, int a) { int means = 1; if ( a == 1 ) return 0; if ( a == 2 ) return 1; for ( ; i <= (int)sqrt(a); i++ ) { if ( a % i == 0 ) means += check(i, a/i); } return means; } int main() { int n, i, a; cin >> n; for ( i = 1; i <= n; i++ ) { cin >> a; cout << check(2, a) << endl; } }
1
292
void main() { int f(int x,int m); int k,i,j,n,sum=0; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&k); for(j=2;j<=k;j++) { if(k%j==0) { sum+=f(k,j); } } printf("%d\n",sum); sum=0; } } int f(int x,int m) { int i,sum=0; if(m==x) sum=1; else { x=x/m; for(i=m;i<=x;i++) { if(x%i==0) { sum+=f(x,i); } } } return sum; }
1
293
/* * factorization.cpp * ?? - 1090 ???? * ???????a?????????????????a = a1 * a2 * a3 * ... * an? * ??1 < a1 <= a2 <= a3 <= ... <= an?????????????????a = a??????? * Created on: 2013-11-20 * Author: ??? */ int k , a; // ?? k void find(int i , int x){ // ?????? for(int j = i; j * j <= x && i != 1; j ++) // ? j&sup2; > x, ???????????? i ? 1, ????? if(x / j * j == x){ // ? k ??? j ?????????????????? find(j , x / j); k ++; } // End if // End for } // End find int main(){ int n; for(cin >> n; n --; ){ k = 0; cin >> a; find(2 , a); cout << ++ k << endl; // ?? a = a ????????? } // End for return 0; }
1
294
// ????.cpp : ?????????????? // int f(int x,int y) { int i,a=1; if(x<y) return 0; if(x==y) return 1; if(x>y) { if(y==1) { for(i=y+1;i<=x;i++) { if(x%i==0) a=a+f(x/i,i); } } else { for(i=y;i<=x;i++) { if(x%i==0) a=a+f(x/i,i); } } return a; } } int main() { int n,j,b=0,p,k; scanf("%d",&p); for(k=1;k<=p;++k) { scanf("%d",&n); b=f(n,1); printf("%d\n",b); } return 0; }
1
295
int main() { int n, t; cin >> n; for(t = 0;t < n;t++) { int m; cin >> m; int f(int a,int min); cout << f(m, 2) << endl; } return 0; } int f(int a, int min) { int i = min; if(a < min) { return 0; } int result = 1; while(i < a) { if(a % i == 0) { result += f(a / i,i); } i++; } return result; }
1
296
// ????2.cpp : ?????????????? // void out( int,int ); int t = 1; int main() { int n = 0; int i = 0; double sum = 0; cin >> n; for( i = 1;i <= n;i++ ) { cin >> sum; out(sum,2.0); cout << t << endl; t = 1; } cin >> i; return 0; } void out(int sum,int q ) { int num = 0; double m = sum; num = sqrt(m); if( sum % q == 0 && q <= num ) { t++; out( sum / q,q ); out( sum,q + 1 ); } if( sum % q != 0 && q <= num ) out( sum,q + 1); }
1
297
int main() { int f(int x, int y); int n,m,i,z; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&m); z=f(1,m); printf("%d\n",z); } return 0; } int f(int x, int y) { int z,t=1,l=0,p; p=(int) pow(y,0.5); if(x==1) x=2; for(z=x;z<=p;z++) { if(y%z==0 && z!=y) { t+=f(z,y/z); } } return t; }
1
298
int d; int fen(int i,int a) { if(i>a) { return 0; } int result=1; int j; for(j=i;j<a;j++) { if(a%j==0) { result=result+fen(j,a/j); } } return result; } int main() { int n; cin >> n; int k=0; while(k<n) { int a; cin >> a; int i=2; d=fen(i,a); cout << d << endl; k++; } return 0; cin.get();cin.get();cin.get(); }
1
299
int f(int a,int b) { if(a==b)return 1; if(b>a)return 0; if(a%b!=0)return f(a,b+1); if(a%b==0)return f(a,b+1)+f(a/b,b); } int main() { int n=0,i=0,x,y; cin>>n; for(i=0;i<n;i++) { cin>>x; y=2; cout<<f(x,y)<<endl; } return 0; }
1