Cod sursa(job #3376347)
| Utilizator | Data | 17 noiembrie 2026 15:39:45 | |
|---|---|---|---|
| Problema | Ridicare la putere in timp logaritmic | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include <bits/stdc++.h>
#define int long long
#define mod 1999999973
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int power(int a,int b)
{
int ans=1,p=a;
while(b>0)
{
if((b&1)>1)
{
ans*=p;
ans%=mod;
}
b>>=1;
p*=p;
p%=mod;
}
return ans;
}
signed main()
{
int a,b;
out<<power(a,b);
return 0;
}
