id
int32
0
32.5k
code
stringlengths
95
8.4k
label
stringclasses
65 values
300
/* *????????.cpp *????? * Created on: 2012-11-30 * ??????????a?????????????????a = a1 * a2 * a3 * ... * an? ??1 < a1 <= a2 <= a3 <= ... <= an?????????????????a = a??????? */ int yinshu(int n,int m) { int i,sum=0; //???? if(n==1) //??if?? return 1; for(i=m;i<=n;i++) //??for?? { if(n%i==0) //????? sum+=yinshu(n/i,i); //????? } return sum; } int main() //??? { int n,i,m; //???? cin>>n; //???? for(i=1;i<=n;i++) //??for?? { cin>>m; //???? cout<<yinshu(m,2)<<endl; //????????? } return 0; //???? }
1
301
void main() { int zy(int a,int b); int j,n,m,sum; scanf("%d",&n); for(j=1;j<=n;j++) { scanf("%d",&m); sum=zy(2,m); printf("%d\n",sum); } } int zy(int a,int b) { int i,c,t=1; c=0; for(i=a;i*i<=b;i++) { if(b%i==0) c=zy(i,(b/i))+c; } if(i*i>b) c=c+1; return(c); }
1
302
int sep(int a, int b) { int i; int ans = 0; if (a == 1) ans = 1; for (i = b; i <= a; i++) { if (a%i == 0) { ans += sep(a / i, i); } } return ans; } int baka(int a) { int cirno; cirno = sep(a, 2); return cirno; } int main() { int n, pre; int i,j; int ans; scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%d", &pre); ans = baka(pre); printf("%d\n", ans); } }
1
303
int count; void f(int a ,int b) { int j; if(a==1) count+=1; else { for(j=b;j<=a;j++) { if(a%j==0) f(a/j,j); } } } int main() { int n,i,number; scanf("%d",&n); for(i=0;i<n;i++) { count=0; scanf("%d",&number); f(number,2); printf("%d\n",count); } return 0; }
1
304
/** * @file homework.cpp * @author ?? * @date 2010?12?03 * @description * ??????: 1090 ???? */ void jisuan(int ,int); int times, sum, i, n; int main() { cin >> times; for (i=0;i<times;i++) { sum = 0; cin >> n; jisuan (n, 2); cout << sum << endl; } return 0; } void jisuan(int n, int j) { int i; for (i=j;i<=n;i++) { if (n > 1) { if (n % i == 0) { if (n % i != 0 && n > i) sum++; jisuan (n / i, i); } } if (n == i) sum ++; } }
1
305
void fenjie(int); int solutionnum=1;//????????1??? int main() { int n,a,i; cin>>n;//???? for(i=1;i<=n;i++) {cin>>a;//?????? fenjie(a);//??????????? cout<<solutionnum<<endl;//?? solutionnum=1;//????? } return 0; } int yinzi[100]={2},i=0; //yinzi???????????????????????????????????????????????? void fenjie(int x) {int j; for(j=yinzi[i];j<x;j++) {if(x%j==0&&x/j>=j)//j?x????????x??j????????j,?????? {i++; yinzi[i]=j;//????????????? fenjie(x/j);//????? j=yinzi[i]; i--;//????? solutionnum++;}//????+1 } }
1
306
int f(int x,int y) { int a,n=1; for(a=y;a<=sqrt(x);a++) { if(x%a==0) { 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]=f(x[i],2); } for(i=0;i<m;i++) { printf("%d\n",n[i]); } return 0; }
1
307
int counts = 1; int ty(int, int); int main() { int i, m, n, c; cin >> m; for(i = 1 ; i <= m ; i++) { cin >> n; counts = 1; c = ty(n, 2); cout << c << endl; } return 0; } int ty(int n, int j) { int i, flag = 0; if(n == 1) { return 0; } if(n == 2) { return 1; } for(i = j ; i <= (int)sqrt(n) ; i++) { if(n % i == 0) { counts++; ty(n / i, i); } } return counts; }
1
308
//???? int divide(int n,int i); //???? n???????i????????? 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+divide(n,j); } cout<<sum+1<<endl; } return 0; } int divide(int n,int i) //???????????????1??? { int num=0; if(n%i==0) { if(n==i) //?????????????????1 { return 1; } for(int j=2;j<=i;j++) { num=num+divide(n/i,j); //?? } return num; } else { return 0; } }
1
309
//***************************************************** //*?????????.cpp * //*?????? * //*?????2010?12?8? * //*???????????????? * //***************************************************** int answer=0;//??????? int a=2;//???2???? void f(int,int);//????? int main()//??? { int n=0; int i=0; int data[100]={0}; cin>>n;//???? for(i=0;i<n;i++) { cin>>data[i]; } for(i=0;i<n;i++) { f(data[i],a); cout<<answer<<endl; answer=0;//?? } } void f(int m,int n)//??? { int i=0; if(m==1)//??????1 ????????? { answer=answer+1; } for(i=n;i<=m;i++)//???2????? { if(m%i==0) { f(m/i,i); } } }
1
310
int cal(int M, int N) { int i; int num=0; if(M==1) return 0; if(N>=M) return ( 1+cal(M,M-1)); for(i=2;i<M;i++) { if(M%i==0&&i<=N) num=num+cal(M/i,i); } return num; } int main() { int n,M; cin>>n; while(n--) { cin>>M; cout<<cal(M,M)<<endl; } return 0; }
1
311
int count; void fun(int m,int n) { if(m <=sqrt(n)){ for (int a=m;a <=sqrt(n);a++) { if(n%a==0){ count ++; fun (a,n/a);} else count=count; }} else count=count; } main() { int n;scanf("%d",&n); for (int i =0;i<n;i++) { count=0; int num;scanf("%d",&num); for(int j=2;j<=sqrt(num);j++) { if(num%j==0) {count ++; fun(j,num/j);} } printf ("%d\n",count+1); }}
1
312
/* *????????.cpp *????? *????: 2012-11-25 *??????????????? */ int b, j, f[1010]; void factorization(int x) { int now, i; for (i = 2; i <= x; i++) { if (x % i == 0 && i >= f[j]) { f[++j] = i; now = x / i; if (now == 1) { b++; } else { factorization(now); } j--; } } return; } int main () { int n, i, num; cin >> n; for (i = 0; i < n; i++) { b = 0; j = 0; memset (f, 0, sizeof(f)); cin >> num; factorization(num); cout << b << endl; } return 0; }
1
313
int f(int q,int x) { if(q<x) { int i,k,p,sum; k=0;sum=0;p=0; for(i=2;i<=x/2;i++) if(x%i==0) k=k+1; if(k==0) return 1; else { for(i=2;i<=sqrt(x);i++) { if(x%i==0) { if(i<q) continue; else sum=sum+f(i,x/i); } } return sum+1; p=0; sum=0; } } else { if(q==x) return 1; else return 0; } } //??? int main() { int n,i,x,sum,p; p=0; sum=0; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&x); sum=f(2,x); printf("%d\n",sum); } return 0; }
1
314
int sushu(int b) { int flag=1,i; if(b==2) return 1; if(b%2==0) return 0; for(i=2;i<=b/2;i++) { if(b%i==0) { flag=0; break; } } if(flag==0) return 0; else return 1; } int number(int a,int b) { int i,total=1; if(sushu(a)) { total=1; return total; } for(i=b;i<=a;i++) { if(a%i==0&&a/i>=i) { total=total+number(a/i,i); } } return total; } void main() { int n,i,A[100],B[100]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&A[i]); B[i]=number(A[i],2); } for(i=0;i<n;i++) { printf("%d\n",B[i]); } }
1
315
int fact(int a, int min) { if (a<min) return 0; int way = 1; for (int i = min; i <= sqrt((double)a); i++) if (a%i == 0) way += fact(a / i, i); return way; } int main() { int n; cin >> n; for (int i = 0; i<n; i++) { int c; cin >> c; cout << fact(c, 2) << endl; } return 0; }
1
316
/* *????111120 04.cpp *?????? *?????2011-11-22 *????????????? */ int g=0; //????????? void s(int n,int z) //???? { for(int i=2;i<=sqrt(n);i++) //???????????? { if(n%i==0&&i>=z) { g=g+1; s(n/i,i); } } } int main() //??? { int a,b; cin>>a; //???? while(cin>>b) //?????? { for(int j=2;j<=sqrt(b);j++) //???????????? { if(b%j==0) { g=g+1; s(b/j,j); //?????? } } cout<<g+1<<endl; //??? g=0; //???? } return 0; //?? }
1
317
int f(int, int); int main() { int x, n, i; cin >> n; for (i = 1; i <= n; i++) { cin >> x; cout << f(x, 2) << endl; } return 0; } int f(int x, int i) { int ans = 0; if (x == 2) { return 1; } else { for (; i <= sqrt(x); i++) { if (x % i == 0) { ans = ans + f(x / i, i); } } return ans + 1; } }
1
318
int f(int m,int j); int main() { int n,m; cin>>n; for(int i=0;i<n;i++) { cin>>m; cout<<f(m,2)<<endl; } return 0; } int f(int m,int j) // { int num=1; for(int i=j;i<=sqrt(m);i++) { if(m%i==0) { num+=f(m/i,i); } } return num; }
1
319
int shi(int a) { int b=sqrt(a); for(int i=2;i<=b;i++) { if(a%i==0)return 0; } return 1; } int shu(int m,int k) { int a=1; for(int j=k;j<=sqrt(m);j++) { if(m%j==0&&m/j>=k) { a++; if(shi(m/j)==0)a+=shu(m/j,j)-1; } } return a; } int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++) { int m,a; scanf("%d",&m); printf("%d\n",shu(m,2)); } return 0; }
1
320
int f(int s,int num) //s?????num????? { if(s==num) return 1; if(s<num) for(int i=s;i<=num;i++) { if(num%i==0) { if(i<num) return f(i,num/i)+f(i+1,num); if(i==num) return 1; } } if(s>num) return 0; } int main() { int n,i,num; cin>>n; for(i=0;i<n;i++) { cin>>num; cout<<f(2,num)<<endl; } return 0; }
1
321
int s=0,p; int a[100]; void factor(int m,int n,int t){ int i; for(i=2;i<=(int)sqrt(n);i++) if((n%i==0)&&(i>=m)){ s++; factor(i,n/i,t+1); } return; } int main(){ int i,j=0,k; scanf("%d",&j); for(k=0;k<j;k++) scanf("%d",&a[k]); for(k=0;k<j;k++){ p=a[k]; s=0; for(i=2;i<=(int)sqrt(p);i++) if(p%i==0){ s++; factor(i,p/i,2); } a[k]=s; } for(k=0;k<j;k++) printf("%d\n",a[k]+1); return 0; }
1
322
/** *???4.cpp *?????? *??????? *???12?1? */ int num,s=1; //??num??????s??????? void divide(int n,int a) //?????n????a?????? { for(int i=n;i<=a/s;i++)//?? { s*=i; if(s==a) //???????a???????+1 num++; else if(s<a && a%s==0) //??????a,?????????? divide(i,a); s/=i; //???? } } int main() //??? { int n,i,a; cin>>n; //???????? for(i=0;i<n;i++) { num=0; //????????0 cin>>a; //?????? divide(2,a); //?????? cout<<num<<endl; } return 0; }
1
323
int f(int m,int n)//????? { if(m<n||m/n==1)//?????????2?????0 return 0; if((m%n==0)&&m/n>=n)//?m???n??m/n?????n return f(m/n,n)+f(m,n+1)+1; else//?????? return f(m,n+1); } int main() { int q,i; cin>>q; for(i=1;i<=q;i++) { int p; cin>>p; cout<<f(p,2)+1<<endl;//?1????????????? } return 0;//???? }
1
324
int divmet(int n,int i); 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;j++) { sum=sum+divmet(n,j); } cout<<sum<<endl; } return 0; } int divmet(int n,int i) { int num=0; if(n%i==0) { if(n==i) { return 1; } for(int j=2;j<=i;j++) { num=num+divmet(n/i,j); //?? } return num; } else { return 0; } }
1
325
int f(int a,int min) { if(a<min) { return 0; } int result=1,i; for(i=min;i<a;i++) { if(a%i==0) { result+=f(a/i,i); } } return (result); } int main() { int n,a[100],b[100],i; scanf("%d\n",&n); for(i=0;i<n;i++) { scanf("%d\n",&a[i]); } for(i=0;i<n;i++) { b[i]=f(a[i],2); } for(i=0;i<n;i++) {printf("%d\n",b[i]);} return 0; }
1
326
int main() { int i,j,num[100],n,m; int fj(int ,int ); scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d",&num[i]); for(i=1;i<=n;i++) printf("%d\n",fj(2,num[i])); return 0; } int fj(int k,int n) { int c,i,sum=1; if(n==2) return(sum); else if(n==3) return(sum); else { c=(int)sqrt(n); for(i=k;i<=c;i++) if(n%i==0) sum=sum+fj(i,n/i); return(sum); } }
1
327
int num = 0, t = 2; void detach(int n) { int i; int q = t; // ?q???t?????? if (n == 1) // n?1?????1 { num++; } else { for (i = t; i <= n / 2; i++) // ?t?n/2?????n?? { if (n % i == 0) { n = n / i; t = i; // ?????n??n/i?????i?n/2 detach(n); // ???? n = n * i; // ??n?t t = q; } } if (i > n / 2 && n >= t) // ???????????n = n??????? { n = 1; detach(n); } } } int main() { int n, a; cin >> n; for (int i = 1; i <= n; i++) { cin >> a; // ??????? detach(a); // ?????? cout << num << endl; // ?????? num = 0; // ????????0 t = 2; } return 0; }
1
328
int fg(int k,int m) { int j,d=0; if (m==1) { d=1; } for(j=k;j<=m;j++) { if (m%j==0) d=d+fg(j,m/j); } return(d); } int main() { int n,i,a[40000],b[40000],s; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&a[i]); } for(i=1;i<=n;i++) { b[i]=fg(2,a[i]); printf("%d\n",b[i]); } return 0; }
1
329
//* * * * * * * * * * * * * * * * * * * * * * * * //*???????? * //*???????? .cpp * //*????? 1000012839 * //*???2010.12.04 * //* * * * * * * * * * * * * * * * * * * * * * * * int ways(int a, int min); // ????ways?????????a??????,a??????min? int main() { int n, a, i, sum = 0, k, min; // n?????????,a????????????i,k?a??????min??????sum? cin >> n; for (i = 0; i < n; i++) { cin >> a; sum = 0; for (k = 2; k <= a; k++) { if (a % k == 0) { min = k; break; } } // ??????? if (a != min) sum = ways(a, min); // ??a?????????? else sum = 1; // ??a????????????? cout << sum << endl; } return 0; } int ways(int a, int min) { int result = 1, i; // result????1??a = a???,i?????? if(a < min) return 0; // ????????????? for (i = min; i < a; i++) { if (a % i == 0) result += ways(a / i, i); // ?????i??a/i???????????? } return result; }
1
330
void main() { int zy(int a,int b); int j,n,m,sum; scanf("%d",&n); for(j=1;j<=n;j++) { scanf("%d",&m); sum=zy(2,m); printf("%d\n",sum); } } int zy(int a,int b) { int i,c,t=1; c=0; if(a==0) c=c+1; else {for(i=a;i*i<=b;i++) { if(b%i==0) c=zy(i,(b/i))+c; } if(i*i>b) c=c+1;} return(c); }
1
331
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 m,x,j,k; scanf ( "%d", &m ); for( j = 1;j <= m; j++ ) { scanf ( "%d", &x ); k = factor ( x, 2); printf ( "%d\n", k); } return 0; }
1
332
int num=0; void asd (int i,int q) { int j; for(j=q;j>1;j--) { if(i%j!=0) continue; if(i==j) { num++; } else { q=j; asd(i/j,q); } } } int main() { int n,o; cin>>n; for(o=0;o<n;o++) { num=0; int a; cin>>a; asd(a,a); if(num==1) cout<<1<<endl; else cout<<num<<endl; } }
1
333
int factor(int N,int min); int main() { int m,n,i,k; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&m); k=factor(m,2); printf("%d\n",k); } return 0; } 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; }
1
334
int s=0; void devide(int,int); int main() { int n,m; cin>>n; while(n--) { cin>>m; s=0; devide(2,m); cout<<s+1<<endl; } return 0; } void devide(int a,int b) { int i; for(i=a;i<=sqrt(b);i++) { if(b%i==0) { s++; devide(i,b/i); } } }
1
335
int f(int a,int x) { int i,j; if(x==2) return 1; else { int result=1; for(i=a;i<=x;i++) if(x%i==0&&x/i>=i) result=result+f(i,x/i); return result; } } main() { int i,j,k; int n; scanf("%d",&n); for(i=0;i<n;i++) { int a; scanf("%d",&a); printf("%d\n",f(2,a)); } }
1
336
int cal(int y,int x) { int i,sum; if (x==1) return 1; else { sum=0; for (i=y;i<=x;i++) { if ((x%i==0)&&((x/i==1)||(x/i>y))) sum+=cal(i,x/i); } return sum; } } int main() { int n,i,l; scanf("%d",&n); for (i=1;i<=n;i++) { scanf("%d",&l); printf("%d",cal(2,l)); if (i!=n) printf("\n"); } return 0; }
1
337
//??????sum??????????temp?????? int sum ,temp ; void fact(int) ;//??fact????int????? int main () { int n , i , k ; cin >> n ; for ( i = 0 ; i < n ; i++ ) { cin >> k ; sum = 0 ; temp = 2 ;//???????????????????????? fact(k) ; cout << sum << endl ; } return 0 ; } void fact(int k) { if ( k == 1 )//??????? { sum++ ; return ; } int i ;//i?????k???????temp?????????????????????????? for ( i = temp ; i <= k ; i++ ) { if ( k % i == 0 ) { temp = i ;//??temp? fact(k/i) ;//??????? } } }
1
338
int sum; void f(int x,int i){ if(x == 1) sum++; else{ for(;i <= x;i++) if(x%i == 0) f(x/i,i); } } int main(){ int n; cin>>n; while(n>0){ int x = 0,i,ans = 1; cin>>x; for(i = 2;i*i < x;i++){ if( x%i == 0) { sum = 0; f(x/i,i); ans+=sum; } } cout<<ans<<endl; n--; } return 0; }
1
339
//???????????????????????????? //?a??????????min??? //????????????? int F(int min,int a) { int i; int sum=0; if(min==a) //???????? return 1; if(a==1) return 1; //??????? for(i=min;i<=a;i++) { if(a%i==0) sum+=F(i,a/i); //?????????? } return sum; //??? } int main() { int a,n; int i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a); printf("%d\n",F(2,a)); } return 0; }
1
340
int n, a, cnt = 0, num; int decompose(int x, int y) { int i, xnum = 1; if(x == 1) return 0; if(x == 2) return 1; for(i = y; i <= (int)sqrt(x); i++) if(x % i == 0) xnum += decompose(x / i, i); return xnum; } int main() { cin >> n; while(cnt < n) { cin >> a; num = decompose(a, 2); cout << num << endl; cnt++; } return 0; }
1
341
int varieties=0,p; int dfs(int dep,int last,int k) //???????????k????? ?? { if (k == 1) //??k=1 { varieties++; //???+1 return 0; } for (int i = last; i <= k; i++) if (k % i == 0) //??k??i????????????k=1 { dfs(dep+1,i,k/i); } } int main() { int i,n,t; cin>>n; //?????? int m[n]; //????n???????? for(i=0;i<n;i++) { cin>>t; dfs(0,2,t); m[i]=varieties; varieties=0; } for(i=0;i<n;i++) cout<<m[i]<<endl; //??????????? return 0; }
1
342
int sum=0; int f(int a,int b) { for(int i=a;i>1;i--) { if(a%i!=0) {continue;} else { if(i>b) {continue;} else { int q; q=a/i; if(q==1) {sum++;} else {f(q,i);} } } } return sum; } int main() { int n; cin>>n; for(int i=1;i<=n;i++) { int num; cin>>num; int c; c=f(num,num); cout<<c<<endl; sum=0; } return 0; }
1
343
/************************************ *??????? * *?????? 1200012921 * *???2012-11-30 * *************************************/ int part(int x, int t) //x???????? { int i; int number = 1; //?x???????????number? if (x == 1) //x=1????? { return 0; } if (x == 2) //x=2????????? { return 1; } for (i = t; i <= sqrt(x); i++) //??????? { if (x % i == 0) //?????? { number += part(x / i, i); //?? } } return number; //???????number } int main() { int i, n, a; cin >> n; //n??? for (i = 1; i <= n; i++) //?????????a????????? { cin >> a; cout << part(a, 2) << endl; } return 0; }
1
344
//???????? int kind(int num,int min); //????kind???num???????min????????? int main() //????? { int n; int i; int num; cin>>n; for(i=1;i<=n;i++) { cin>>num; //??????n???????????????????? cout<<kind(num,2)<<endl; } return 0; } //????? int kind(int num,int min) //kind???? { if(num<min) //??num??min??????????min?????????0 {return 0;} int k=1; //????????num=num?????????? int i; for(i=min;i<=num;i++) { if(num%i==0) //?????? { k=k+kind(num/i,i); //?k????num?????i???????????????????????????????min? } } return k; //?????k }
1
345
int yinshu(int be,int by) { int i,sum=0;//cout<<be<<' '<<by<<endl; for(i=by;i*i<=be;i++) { if(be%i==0){sum+=1+yinshu(be/i,i);} } return sum; } int main() { int n,i,j,num,sign ; cin>>n; for(i=0;i<n;i++) { cin>>num;for(j=num;j>1;j--)if(num%j==0)sign=j; cout<<yinshu(num,sign)+1<<endl; } getchar();getchar(); return 0; }
1
346
int fen(int a,int k) { int s=0,j,t=0; if(a==1&&a>=k) { s=1; } else if(a==k) {s=1;} else { for(j=2;j<=a;j++) { if(a%j==0&&j>=k) s=s+fen(a/j,j); t=1; } if(t==0) s++; } return s; } int main() { int n,i,q,a; cin>>n; for(i=1;i<=n;i++) { cin>>a; cout<<fen(a,1)<<endl; } cin>>q; return 0; }
1
347
//============================================================================ // Name : 30fenjie.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ int factorize(int a, int b) { int factor,i; if(a==1) factor=1; if(a!=1) factor=0; for (i=b;i<=a;i++) if (a%i==0) factor=factor+factorize(a/i,i); return factor; } int main() { int n, a; for (cin>>n; n--; cout<<factorize(a,2)<<endl) { cin>>a; } }
1
348
/* ?? - 1090 ???? ?? ???????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 */ void main() { int st(int a,int b); //????st?????????a?=a1?b??????? int j,n,m,sum; scanf("%d",&n); for(j=1;j<=n;j++) { scanf("%d",&m); sum=st(2,m); printf("%d\n",sum); } } int st(int a,int b) { int i,c; c=0; if(a==0) c=c+1; else { for(i=a;i<=sqrt(b);i++) { if(b%i==0) c=st(i,(b/i))+c; } if(i>sqrt(b)) c=c+1; } return c; }
1
349
int main() { int brea(int a,int min); int i,n,a; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&a); printf("%d\n",brea(a,2)); } } int brea(int a,int min) { int result=1; int i; if(a<min) return(0); else if(a==min) return(1); else { for(i=min;i<a;i++) { if(a%i==0) { result=result+brea(a/i,i); } } return(result); } }
1
350
void fenjie( int i , int a ) ; int k = 1 ; int main() { int n , m , a ; cin >> n ; for( m = 1 ; m <= n ; m ++ ) { cin >> a ; fenjie( 2 , a ) ; cout << k << endl ; k = 1 ; } return 0 ; } void fenjie( int i , int a ) { for( ; i <= sqrt( a ) ; i ++ ) if( a % i == 0 ) { k ++ ; fenjie( i , a / i ) ; } }
1
351
int count(int x,int y)//????????? { if(x<y) return 0;//???? if(x>=y) { int sum=0; for(int j=y;j<x;j++) { if(x%j==0) sum=sum+count(x/j,j);//??? } return sum+1; } } int main() { int n; cin>>n; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++) cout<< count(a[i],2) <<endl; return 0; }
1
352
int sum=0,g,f; int divide (int chushu,int a) { int i; for (i=chushu;i<=a;i++) { if (a%i==0) { f=a/i; if (f>1) {g=i;divide (g,f);} else { sum++; } } } return sum; } int main() { int n=0; cin>>n; int p=0; for (p=0;p<n;p++) { int b=0,c=2; cin>>b; sum=0; cout<<divide (c,b)<<endl; } return 0; }
1
353
int divide(int,int); int main(void) { int n,a; cin>>n; while(n!=0) { cin>>a; cout<<divide(a,2)<<endl; n--; } return 0; } int divide(int x,int t) { int i,sum=0; if(x==1) return 1; //????x?1 for(i=t;i<=x;i++) { if(x%i==0) sum+=divide(x/i,i); //?i?x????x/i???????????????i? } return sum; }
1
354
int l=0,num=0,o; void f(int i,int in) { int j; for(j=i;j<(in+1);j++) { if(j*(in/j)==in) { // out[l]=j; // l=l+1; o=in/j; /*cout<<j<<endl; cout<<"----------------------"<<endl;*/ f(j,in/j); o=o*j; } //else f(j+1,in); } if(o==1) {num=num+1;/*cout<<"**************************"<<endl;*/} } int main() { int t; cin>>t; int i; int in; for(i=0;i<t;i++) { cin>>in; f(2,in); cout<<num<<endl; num=0; } return 0; }
1
355
int fuck(int n,int m) { int i,cnt=1; if(m>=sqrt(n)) {return 1;} for(i=m;i<=sqrt(n);i++) { if(n%i==0) { cnt+=fuck(n/i,i); } } return cnt; } int main() { int t, n, k; cin>>t; for(k=1;k<=t;k++) { cin>>n; cout<<fuck(n,2)<<endl; } int x;cin>>x; return 0; }
1
356
/* * 11.27.cpp * * Created on: 2011-11-27 * Author: Administrator */ int coun; // ??????? void depart(int n,int i) { int j; if (n==1) coun++ ; else for (j=i;j<=n;j++) //???j?? ?????? if (n%j==0) {depart(n/j,j);} } int main (){ int n,j; cin>>n; int b[n]; //??????? for(j=0;j<n;j++) cin>>b[j]; for(j=0;j<n;j++) { coun=0; //????? depart(b[j],2); cout<<coun<<endl; } return 0; }
1
357
int meide(int x,int y) { int sum=1,count=0,i; for(i=y;i<=sqrt(x);i++) { if(x%i==0) { sum=sum+meide(x/i,i); } } return sum; } int main() { int k,n,m; scanf("%d",&k); for(m=0;m<k;m++) { scanf("%d",&n); if(n>=3) { printf("%d\n",meide(n,2)); } else { printf("1\n"); } } return 0; }
1
358
int main() { int i,n; int fun(int n,int begin); scanf("%d",&i); while (i-->0) { scanf("%d",&n); printf("%d\n",fun(n,2)); } return 0; } int fun(int n,int begin) { int i,result=1; for (i=begin;i<=sqrt(n);i++) if (n%i==0) result+=fun(n/i,i); return result; }
1
359
int n; void count(int x,int y) { int i; if(x==1) n=n+1; else { for(i=y;i<=x;i++) { if(x%i==0) count(x/i,i); } } } int main() { int i,k,t; void count(int x,int y); scanf("%d",&k); for(i=0;i<k;i++) { n=0; scanf("%d",&t); count(t,2); printf("%d\n",n); } return 0; }
1
360
int f(int a,int b); int main() { int n,a,i; cin>>n; for(i=0;i<n;i++) { cin>>a; cout<<f(a,2)<<endl; } return 0; } int f(int x,int y) //y????? { int j,k,t=0,m=0; for(j=2;j<x;j++) if(x%j==0) t++; if(t==0) return 1; //?????,??1 else { for(k=y;k<=(int)sqrt((double)x);k++) if(x%k==0) m=m+f(x/k,k); return (m+1); } }
1
361
void count(int, int); int k; int main() { int n, i, j, m; int num; cin >> n; for (i = 0; i < n; i++) { k = 0; cin >> num; m = sqrt(num) + 1; for (j = 2; j < m; j++) if (num % j == 0) { k++; count(num / j, j); } cout << k + 1 << endl; } return 0; } void count(int num, int i) { int j; int n = sqrt(num); for (j = i; j <= n; j++) { if (num % j == 0) { k++; count((num / j), j); } } }
1
362
int fib(int a,int e); int main(){ int n,b,i; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",&b); printf("%d\n",fib(b,2)); } scanf("%d",&n); return 0; } int fib(int a,int e){ int j,c,d; c=1; if(a<=e) return 1; for(j=e;j<=sqrt(a);j++){ if(a%j==0){ d=a/j; c=c+fib(d,j); } } return c; }
1
363
int s[100]; 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; } main() {int m,mm; scanf("%d",&m); for(int i=0;i<m;i++){ scanf("%d",&mm); /*for(int i=0;i<m+1;i++){s[i]=0;printf("%d",s[i]);}*/ printf("%d\n",f(mm,2));} }
1
364
int i,n,k; int work(int p,int n) { if (n==1) k++; for (int i=p;i<=n;i++) if (n%i==0) work(i,n/i); } int main() { int m; cin>>m; while (m>0) { cin>>n; k=0; work(2,n); cout<<k<<endl; m--; } return 0; }
1
365
int f(int i,int t) { if(i<t) {return 0;} int b=1; int a; for(a=t;a<i;a++) { if(i%a==0) {b=b+f(i/a,a);} } return b; } int main() { int n; scanf("%d",&n); int i=0; int d[100]; do { scanf("%d",&d[i]); i++; }while(i<n); i=0; do { printf("%d\n",f(d[i],2)); i++; }while(i<n); return 0; }
1
366
//************************************* // ????** // ?? 1200012872** // 2012.11.27** //************************************* int factorization(int a, int k); int main() { int n, a; cin >> n; for (int i = 0; i < n; i++) //?????????????? { cin >> a; cout << factorization(a, 2) << endl; } return 0; } int factorization(int a, int k) { int sum = 1; //??????? if (a == 1) //??a?1????? { return 0; } if (a == 2) //??a?2??????? { return 1; } int b = (int) sqrt ((double)a); //?b?a?????? for (int i = k; i <= b ; i++) //??a???i?????????????????? { if (a % i == 0) { sum += factorization(a / i, i); } } return sum; //??sum? }
1
367
int calc(int p,int t); int main() { int m,n,ans; scanf("%d",&m); while (m--) { scanf("%d",&n); ans=calc(2,n); printf("%d\n",ans); } return 0; } int calc(int p,int t) { int i,a; a=1; for (i=p;i<=sqrt(t);i++) if (t%i==0) a=a+calc(i,t/i); return a; }
1
368
//???? //2010?12?03? //1000012753 ??? int deal(int num, int p) { int i, sum = 0; if(num == 1) return 1; for(i = p; i <= num; ++i) if(num % i == 0) sum += deal(num / i, i); return sum; } int main() { int n, a; cin >> n; while(n--) { cin >> a; cout << deal(a, 2) << endl; } return 0; }
1
369
int cc;//cc&#190;íê&#199;ò&#187;12?&#196;·&#214;&#189;a?&#196;·&#189;·¨&#214;&#214;êy void fen(int x,int h); int main() { int n=0,k=0; cin>>n; for(k=1;k<=n;k++) { cc=0; int ff; cin>>ff; fen(ff,2); cout<<cc<<endl; } return 0; } void fen(int x,int h) { for(int i=2;i<=x;i++) { if((x%i==0)&&(i>=h)&&(i<x)) fen(x/i,i); if((x%i==0)&&(i>=h)&&(i==x)) cc++; } }
1
370
int fi(int a,int j); void main() { int a,n; scanf("%d",&n); while(n--){ scanf("%d",&a); printf("%d\n",fi(a,2)); } } int fi(int a,int k) { int i,b=1; if(a==1) return 0; for(i=k;i*i<=a;i++) if(a%i==0) b=b+fi(a/i,i); return b; }
1
371
//???????a?????????????????a = a1 * a2 * a3 * ... * an???1 < a1 <= a2 <= a3 <= ... <= an?????????????????a = a??????? //Goofy 2010 12 05 void FenJie(int); int counter=0; int Befor=0; int main() { int n, x, i; cin>>n; for(i=0; i<n; i++) { cin>>x; counter=0; Befor=x; FenJie(x); cout<<counter<<endl; } return 0; } void FenJie(int x) { int i, temp=Befor;//????????? if (x==1) { counter++; return; } for(i=Befor; i>1; i--)//?????? { if (x%i==0) { Befor=i; FenJie(x/i); } Befor=temp; } return; }
1
372
void main() { int ways(int a, int min); int n,b; scanf("%d",&n); while(n-->0) { scanf("%d",&b); printf("%d\n",ways(b,2)); } } int ways(int a, int min) { if(a<min) return 0; int sum=0,i; for(i=min;i<=sqrt(a*1.0);i++) { if(a%i == 0) sum = sum + ways(a/i, i); } return sum+1; }
1
373
/* * main.cpp * * Created on: 2012-11-12 * Author: ?? * 1090 ???? */ int sum; int a[100]; void search(int t,int k) { int i; if (k==1) sum++; else for (i=a[t-1];i<=k;i++) if (k%i==0) {a[t]=i;search(t+1,k/i);} } int main() { int n,i,k; cin>>n; for (i=1;i<=n;i++) { cin>>k; sum=0; a[0]=2; search(1,k); cout<<sum<<endl; } return 0; }
1
374
/* ???? ?? ????????????? f[i,j]????i????j????????? ?????????? i?j????N?????O(sqrt(n))??? ????? ?????O(n^(3/2)) ?????O(n) */ int main() { int f[200][200] = {0}; int div[40000] = {0}; int divth[200] = {0}; int kase = 0; cin >> kase; for (; kase > 0; kase --) { int n = 0; cin >> n; memset(f,0,sizeof(f)); memset(div,0,sizeof(div)); memset(divth,0,sizeof(divth)); int m = 0; for (int i = 1; i <= n; i ++) if (n % i == 0) { div[i] = ++m; divth[m] = i; } f[1][1] = 1; for (int i = 2; i <= m; i++) for (int j = 2; j <= i; j++) for (int k = j; k > 1; k--) if (divth[i] % divth[k] == 0) { int ii = divth[i] / divth[k]; int jj = k; if (div[ii] < jj) jj = div[ii]; f[i][j] += f[div[ii]][jj]; } cout << f[m][m] << endl; } return 0; }
1
375
int DFS(int ,int ); int main() { int q; cin>>q; for(int i=0;i<q;i++) { int n; int h=0; cin>>n; cout<<DFS(n,n)<<endl; } return 0; } int DFS(int n,int p) { int ans=0; if(n==1)return 1; for(int i=2;i<=p;i++) { if(n%i==0) { ans=ans+DFS(n/i,i); } } return ans; }
1
376
int factor(int a,int min){ int i,result=1; if(a<min) return 0; for(i=min;i<a;i++){ if(a%i==0) result+=factor(a/i,i); } return result; } int main(){ int n,i,a[100]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); a[i]=factor(a[i],2); } for(i=0;i<n;i++){ if(i==n-1) printf("%d",a[i]); else printf("%d\n",a[i]); } return 0; }
1
377
//******************************** //*???1.cpp ** //*?????? 1200012768 ** //*???2012.11.28 ** //*??????? ** //******************************** int fun(int n, int m); int main() { int n, num; cin >> n; for (int i = 0; i < n; i++) { cin >> num; cout << fun(num, 2) << endl; } return 0; } int fun(int n, int m) { int sum = 1; //n?????????? double t = sqrt(n); for (int i = m; i <= t; i++) //???????????????t if (n % i == 0) //???i?n??????????? sum += fun(n /i, i); return sum; }
1
378
int s=0,p=1; void fenjie(int a,int b) { int i; if(a==1) s++; for(i=b;i<=a;i++) if(a%i==0) fenjie(a/i,i); return; } int main() { int n,i,j,a[100]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); for(j=2;j*j<=a[i];j++) { if(a[i]%j==0) { s=0; fenjie(a[i]/j,j); p=p+s; } } printf("%d\n",p); p=1; } return 0; }
1
379
int main() { int n,i,fenjie(int x,int y),*a,re=0,j;//x?????????y??????????? scanf("%d",&n); a=(int*)malloc(n*sizeof(int)); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { printf("%d\n",fenjie(a[i],2)+1); } return 0; } fenjie(int x,int y) { int i,flag=0,re=0,flag2=0,k=0; if(x<y) return 0; else if(x==y) return 0; else { for(i=y;i<x;i++) { if(x%i==0) flag2+=1; } if(flag2==0) return 0; else { for(i=y;i<=x;i++) { if(x%i==0) { re+=fenjie(x/i,i); if(x/i>=i) k+=1; } } re+=k; return(re); } } }
1
380
int num,t,yin[50]; void dd(int n, int a,int d ,int m) { int i; if(d==m) { t++; return; } for(i=a;i<num;i++) { if(n/yin[i]>=yin[i]&&n%yin[i]==0) dd(n/yin[i],i,d+1,m); } } void q_ys(int n) { int i; for(i=2;i<=n;i++) if(n%i==0) { num++; yin[num]=i; } return ; } int m_ys(int n) { int i; for(i=2;i<=sqrt(n);i++) { if(n % i==0 ) { return i; } } return 1; } void output(int y) { int k=1,i,x; x=y; t=1,num=0,memset(yin,0,sizeof(yin)); q_ys(x); while(m_ys(x)!=1) { k++; x=x/m_ys(x); } for(i=2;i<=k;i++) dd(y,1,1,i); cout<<t<<endl; } int main() { int n,i,a[1000]; t=0,num=0; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; for(i=1;i<=n;i++) output(a[i]); return 0; }
1
381
int f(int a,int b) { if(a < b) return 0; int i,r =1 ; for(i = b; i <= a; i++ ) { if( !(a%i) && i <= a/i ) { r += f(a/i,i); } } return r; } void main() { int n,m; scanf("%d",&n); while(n--) { scanf("%d",&m); int result = f(m,2); printf("%d\n",result); } }
1
382
int Factorization(int,int); int main() { int n,x,i,k; cin>>n; for(i=0;i<n;i++) { cin>>x; cout<<Factorization(x,2)+1<<endl; } return 0; } int Factorization(int x,int y) { int i; int sum=0; if(x<4) return 0; else { for(i=y;i<=sqrt((double)x);i++) if(x%i==0) sum+=1+Factorization(x/i,i); return sum; } }
1
383
int n,i;//???? n ??????? int f(int a,int min){ //??????f ?????a n if(a < min){ //?????a ??n return 0; //????0? ??????????? } int result = 1; //??????? ???1 for(int i = min;i<a;i++){ //for?? ? ??????a if(a % i == 0){ //?a???i??? result += f(a/i,i); //???? ??result } } return result; //?????? } int main(){ //????? cin>>n;//?????? int a[n]; for(i=0;i<n;i++){ //???? cin>>a[i]; } for(i=0;i<n;i++){ cout<<f(a[i],2)<<endl; //?????????? ???? } return 0; }
1
384
int f(int a,int b) { int c,s=0,i; c=(int)sqrt(a); for(i=b;i<=c;i++) { if(a%i==0) s=s+f(a/i,i); } return s+1; } main() { int n,i; scanf("%d",&n); int num[1000]; for(i=0;i<n;i++) { scanf("%d",&num[i]); printf("%d\n",f(num[i],2)); } }
1
385
//============================================================================ // Name : 9.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ int sum=0;//????sum void devide(int a,int b)//?? { if(a==1) sum++; else { if(a>=b) devide(a,b+1); if(a%b==0) devide(a/b,b); } } int main()//??? { int n,a; cin>>n; for(int i=0;i<n;i++) { cin>>a; sum=0; devide(a,2); cout<<sum<<endl; } return 0; }
1
386
int f(int a,int min) { int result=1,i; if(a<min) return 0; else { for(i=min;i<=a;i++) { if(a%i==0) { result+=f(a/i,i); } } return result; } } int main() { int n,a,i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a); printf("%d\n",f(a,2)); } return 0; }
1
387
int c[1000]={0},d[1000],j; main() { void f(); int i,s; scanf("%d",&s); for(j=0;j<s;j++) { scanf("%d",&d[j]); for(i=2;i<=sqrt(d[j]);i++) { if(d[j]%i==0) { c[j]++; f(i,d[j]/i); } } } for(j=0;j<s;j++) { printf("%d\n",c[j]+1); } } void f(int s,int m) { int k; for(k=s;k<=sqrt(m);k++) { if(m%k==0) { c[j]++; f(k,m/k); } } }
1
388
int a=0,s=0; void find(int n,int prim) { if (n==a){s++;} else { for (int i=prim;i<=a/n;i++) if ((a%(n*i)==0)){find(n*i,i);} } } int main() {int n=0;cin>>n; for (int i=1;i<=n;i++) { cin>>a;s=0; for (int i=2;i<=a;i++) { if (a%i==0) {find(i,i);} } cout<<s<<endl; } return 0; }
1
389
/* * 2.cpp * * Created on: 2012-9-14 * Author: 12006 */ int tmp = 2 ; int suml(int n,int tmp) //?????? { int sum = 0 ; if(n==1) { return 1 ; } for(int i = tmp ; i <=n ; i++) { if(n%i==0) { sum+=suml(n/i,i); } } return sum ; } int main() { int m ; cin >> m ; int n ; for(int i = 0 ; i < m ; i++) { cin >> n ; int zon_shu = 0 ; zon_shu = suml(n,tmp) ; cout << zon_shu <<endl ; } }
1
390
int sum=0,t; //sum?????????,t?????? void dg(int s) //?s???? { for(int i=s;i<=t;i++) { if(t%i==0) //?i??t?? { t=t/i; if(t==1) sum++; //t????,??+1 else dg(i); //?????? t=t*i; } } } int main() { int n; cin>>n; while(n--) //??n? { cin>>t; dg(2); cout<<sum<<endl; sum=0; } return 0; }
1
391
void Factorize(int n, int fact); int number = 0; int main() { int times, num, i; cin >> times; for (i = 0; i < times; i++) { cin >> num; Factorize(num, 2); cout << number << endl; number = 0; } return 0; } void Factorize(int n, int fact) { int i; for (i = fact; i <= sqrt(n); i++) { if (n % i == 0) Factorize(n / i, i); } number++; }
1
392
int a=1; int yinzi(int j,int n) { for(int i=j;i<n;i++) { if(n%i==0&&n!=i&&n/i>=i) { a++; yinzi(i,n/i); } } return 0; } int main() { int n,s; cin>>s; for(int j=0;j<s;j++) { cin>>n; for(int i=2;i<=n;i++) { if(n%i==0&&n/i>=i) { a++; yinzi(i,n/i); } } cout<<a<<endl; a=1; } return 0; }
1
393
int F(int n,int a) { if(n==1) return 1; if(a==1) return 0; if(n%a==0) return F(n/a,a)+F(n,a-1); return F(n,a-1); } main() { int n,a,i; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&a); printf("%d\n",F(a,a)); } }
1
394
int factors(int n,int min) { int varieties=0,i; if(n==1) return 1; else { for(i=min;i<=n;i++) { if(n%i==0) { varieties+=factors(n/i,i); } } } return varieties; } int main() { int n; cin>>n; int a[n],b[n]; int i; for(i=0;i<n;i++) { cin>>a[i]; b[i]=factors(a[i],2); } for(i=0;i<n;i++) cout<<b[i]<<endl; return 0; }
1
395
int f(int,int); int main() { int n,a[32768],i; cin>>n; for(i=0;i<=n-1;i++) { cin>>a[i]; } for(i=0;i<=n-1;i++) { cout<<f(a[i],2)+1<<endl; } return 0; } int f(int a,int p) { int i,sum=0; for(i=2;i<=sqrt(a);i++) { if(((double)a/i==a/i)&&(i>=p)) { p=i; sum=sum+1+f(a/i,p); } } return sum; }
1
396
int factor(int a,int min) { int count=0; for(int i=min;i<=a;i++) { if(i==a) { count+=1; } if(a%i==0) { count+=factor(a/i,i); } } return count; } int main() { int n; cin>>n; while(n--) { int a; cin>>a; int result=factor(a,2); cout<<result<<endl; } return 0; }
1
397
int n,t,cnt; void f(int left,int last){ if(left<last) {if(left==1) cnt++;return;} for (int i=last;i<=left;i++) if(left%i==0) f(left/i,i); } int main(){ scanf("%d",&t); while (t--){ scanf("%d",&n); cnt=0;f(n,2); printf("%d\n",cnt); } return 0; }
1
398
// // main.cpp // ????? // // Created by ???? on 13-11-22. // Copyright (c) 2013? ????. All rights reserved. // int f(int a,int s)//s for start { if(a<=s) return 1; int b=sqrt((float)a),flag=0,sum=1; for(int i=s;i<=b;i++) { if(a%i==0) { flag++; sum=sum+f(a/i,i); } } if(flag==0) return 1; else return sum; } int main() { int a,n; cin>>n; for(int i=1;i<=n;i++) { cin>>a; cout<<f(a,2)<<endl; } return 0; }
1
399
int fenjie(int ,int ); int main() { int i,n,t,r,num; cin>>n; for(i=1;i<=n;i++) { cin>>num; r=fenjie(num,2); cout<<r<<endl; } return 0; } int fenjie(int num,int min) { int i,j,k,r=0; for(i=min;i<=num;i++) { if(num%i==0) { r=r+fenjie(num/i,i); } if(i==num) r++; } return r; }
1