Cod sursa(job #758242)
Utilizator | Data | 14 iunie 2012 23:00:01 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
int x=1,A,B,S=0,d;
ifstream f("sumdiv.in");
ofstream g("sumdiv.out");
f>>A>>B;
while(B!=0){x=x*A;B--;}
for(d=1;d*d<=x;d++)
if (x%d==0)S=S+d;
S=S+x+x/2;
S=S%9901;
g<<S;
return 0;
}