Cod sursa(job #3322885)
| Utilizator | Data | 16 noiembrie 2025 09:16:20 | |
|---|---|---|---|
| Problema | Ridicare la putere in timp logaritmic | Scor | 30 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("lgput.in");
ofstream fout ("lgput.out");
int main()
{
int n,p;
fin>>n>>p;
long long S=1;
while(p>0)
{
S=S*n;
if(S>=1999999973)
{
S=S%1999999973;
}
p--;
}
fout <<S;
return 0;
}
