Cod sursa(job #2397786)
Utilizator | Data | 4 aprilie 2019 19:26:56 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | 0 |
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 f(int n,int p,long long x)
{
if(n==0)
{
return 0;
}
x=x%1999999973;
if(p!=0){
return (n,p--,x*n);
}
}
int main()
{int n,p;
fin>>n>>p;
fout<<f(n,p/2,n)*f(n,p/2,n);
}