天天看点

joj 2344: Dissolution of Integer 将N分解成乘积形式 共有多少种解法

As you known,a positive integer can be written to a form of products of several positive integers(N = x1 * x2 * x3 *.....* xm (xi!=1 (1<=i<=m))).Now, given a positive integer, please tell me how many forms of products.

Input

Input consists of several test cases.Given a positive integer N (2<=N<=200000) in every case.

Output

For each case, you should output how many forms of the products.

Sample Input

12
100
5968
      

Sample Output

4
9
12
      

 //

#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

const int maxn=200001;

int a[maxn],prime[maxn],pl;

int main()

{

    a[1]=1;

    for(int i=2;i<maxn;i++)

    {

        for(int j=1;i*j<maxn;j++)

        {

            a[i*j]+=a[j];

        }

    }

    int n;

    while(scanf("%d",&n)==1)

    {

        printf("%d\n",a[n]);

    }

    return 0;

}

继续阅读