Cod sursa(job #129418)
| Utilizator | Data | 29 ianuarie 2008 13:51:15 | |
|---|---|---|---|
| Problema | Suma divizorilor | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
# include <fstream.h>
# include <math.h>
//using namespace std;
long a,b;
long long x,S;
ifstream fin ("sumdiv.in");
ofstream fout ("sumdiv.out");
int main ()
{
fin>>a>>b;
x=pow(a%9901,b%9901);
for (long long i=1;i<sqrt(x);i++)
if (x%i==0)
{
S=(S+i)%9901;
S=(S+x/i)%9901;
}
if (sqrt(x)== (long long )(sqrt(x)))
S+=(long long)((sqrt(x)))%9901;
fout<<S%9901<<"\n";
return 0;
}
