Cod sursa(job #1819660)

Utilizator viftode4Iftode Vlad viftode4 Data 30 noiembrie 2016 18:41:53
Problema Patrate2 Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <fstream>
using namespace std;
ifstream fin("perechi.in");
ofstream fout("perechi.out");
int n;
int main()
{
    fin>>n;
    int d=2, k=0, p=1;
    while(n%d==0)
    {
        n=n/d;
        k++;
    }
    p=p*(2*k+1);
    d=3;
    k=0;
    while(d*d<=n)
    {
        while(n%d==0)
        {
            n=n/d;
            k++;
        }
        p=p*(2*k+1);
        d=d+2;
        k=0;
    }
    if(n!=1)
        p=p*3;
    fout<<(p+1)/2;
    return 0;
}