Cod sursa(job #3296326)

Utilizator iordacheMatei Iordache iordache Data 12 mai 2025 11:57:22
Problema Ridicare la putere in timp logaritmic Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.43 kb
#include <bits/stdc++.h>
#define pb push_back
//#define int long long
using namespace std;
const int N=2e5+5;int mod=1999999973;
int binpow(int n, int e)
{
    int ans=1;
    while(e)
    {
        if(e&1) ans=1ll*ans*n%mod;
        n=1ll*n*n%mod;
        e>>=1;
    }
    return ans;
}
signed main()
{
    ifstream cin("lgput.in");ofstream cout("lgput.out");
    int a,b;
    cin>>a>>b;
    cout<<binpow(a,b);
}