Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #define MOD 1999999973
- using namespace std;
- int Putere(int a, int n)
- {
- int p =1;
- while(n>0)
- {
- if(n%2==1) p = 1LL * p * a % MOD;
- a=1LL*a*a%MOD;
- n=n/2;
- }
- return p;
- }
- int main()
- {
- int N,P;
- ifstream fin ("lgput.in");
- ofstream fout ("lgput.out");
- fin>>N>>P;
- fout<<Putere(N,P);
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement