Cod sursa(job #2426553)
Utilizator | Data | 28 mai 2019 17:48:19 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 20 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("sumdiv.in");
ofstream g("sumdiv.out");
int a,b;
long long s,p=1;
int main()
{
f>>a>>b;
if(a==1)
{
g<<1;
return 0;
}
for(int i=0;i<+b;i++)
{
s+=p;
p*=a;
}
g<<s+p%9901;
return 0;
}