Pagini recente » Cod sursa (job #2052855) | Cod sursa (job #1009605) | Cod sursa (job #2041025) | Profil yeu1 | Cod sursa (job #1028755)
/*#include<stdio.h>
#define mod 100019
long long va[10002],n,vb2[22],b,ad=1,chestie,s,ac=1;
int main(){
int player_unu=0;
freopen("puteri2.in","r",stdin);
freopen("puteri2.out","w",stdout);
scanf("%lld",&n);
for(int i=0;i<n;i++)
scanf("%lld",&va[i]);
for(int i=0;i<n;i++)
{
scanf("%lld",&b);
ad=va[i];
while(b!=0)
{
vb2[chestie]=b%2;
b=b/2;
chestie++;
}
for(int j=0;j<chestie;j++)
{
if(vb2[j]==1)
{
ac=ac*ad;
}
ad=ad*ad;
ad=ad%mod;
ac=ac%mod;
}
s=s+ac;
for(int i=0;i<chestie;i++)
vb2[i]=0;
ad=0;ac=1;chestie=0;
s=s%mod;
}
printf("%lld",s);
return player_unu;
}*/
#include<stdio.h>
#define mod 1999999973
long long n,vb2[22],b,ad=1,chestie,s,ac=1;
int main(){
int player_unu=0;
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%lld",&n);
scanf("%lld",&b);
ad=n;
while(b!=0)
{
vb2[chestie]=b%2;
b=b/2;
chestie++;
}
for(int j=0;j<chestie;j++)
{
if(vb2[j]==1)
{
ac=ac*ad;
}
ad=ad*ad;
ad=ad%mod;
ac=ac%mod;
}
s=s+ac;
ad=0;ac=1;chestie=0;
s=s%mod;
printf("%lld",s);
return player_unu;
}