Pagini recente » Cod sursa (job #377674) | Cod sursa (job #1524499) | Cod sursa (job #1685408) | Cod sursa (job #3237974) | Cod sursa (job #2176252)
#include <fstream>
#define MOD 1999999973
#define ll long long int
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
ll n, putere;
ll el(ll element, ll putere)
{
ll ret=1;
while (putere)//puterea e >0)
{
if (putere&1)
{
ret=(ret*element)%MOD;
putere--;
}
element=(element*element)%MOD;
putere=putere/2;
}
return ret;
}
int main()
{
fin>>n>>putere;
fout<<el(n,putere);
fin.close();
fout.close();
}