Pagini recente » Cod sursa (job #538683) | Cod sursa (job #461359) | Cod sursa (job #3254618) | Cod sursa (job #801658) | Cod sursa (job #2254106)
//Well, if it isn't fat stinking billy goat Billy Boy in poison! How art thou, thou globby bottle of cheap, stinking chip oil?
//Come and get one in the yarbles, if ya have any yarbles, you eunuch jelly thou!
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll divs[7000];
int pd[4200][4200], p, n, test, guy;
unordered_map<ll, int> m;
int main()
{
ifstream fin ("desc.in");
ofstream fout ("desc.out");
fin >> n >> test;
for (ll i = 2; i*i <= n; ++i) //maybe treat divs[I] = n separately, also case where n is prime
if(n%i == 0){
divs[++p] = i;
++guy;
if(i*i != n)
divs[++p] = n/i;
}
sort(divs+1, divs+p+1);
divs[++p] = n;
for (int i = 1; i <= p; ++i)
m[divs[i]] = i;
for (int i = 1; i <= p; ++i){
pd[i][i] = 1;
for (int j = i-1; j >= 1; --j){
pd[i][j] = pd[i][j+1];
if(divs[i]%divs[j] == 0)
pd[i][j] += pd[m[divs[i]/divs[j]]][j];
}
}
fout << pd[p][1] << "\n";
ll left = n, M = 2;
return 0;
}