Cod sursa(job #2568676)
| Utilizator | Data | 4 martie 2020 09:21:07 | |
|---|---|---|---|
| Problema | BFS - Parcurgere in latime | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.46 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int Mod = 1999999973;
int n, x;
int Lgput(int a, int b)
{
int p = 1;
while(b)
{
if(b % 2) p = 1LL * p * a % Mod;
a = 1LL * a * a % Mod;
b /= 2;
}
return p;
}
int main()
{
fin >> n >> x;
fout << Lgput(n, x) << "\n";
fin.close();
fout.close();
return 0;
}
