Pagini recente » Cod sursa (job #2902324) | Cod sursa (job #1683204) | Cod sursa (job #2625084) | Cod sursa (job #2456727) | Cod sursa (job #1334258)
#include <iostream>
#include <fstream>
#define mod 1999999973
using namespace std;
int power(int a, int b)
{
if (b==0) return 1;
if (b==1) return a;
if (b%2==0) return power((a*a)%mod , (b/2));
return ((a%mod) * power((a*a)%mod, (b/2)));
}
int main()
{
int n,m;
ifstream f("lgput.in");
ofstream g("lgput.out");
f >> n >> m;
g << power(n, m);
f.close();
g.close();
return 0;
}