D.O.P.E Online Judge! prob:-Modulus
–AC–
#include
int main()
{
long long int a,b,res,tmp,i,j,k,c;
for(k=0;k<10;k++){
scanf("%lld%lld%lld",&a,&b,&c);
res=a%c;
res=(res*b)%c;
printf("%lld\n",res);
}
return 0;
}
D.O.P.E Online Judge! prob:-Modulus
–AC–
#include
int main()
{
long long int a,b,res,tmp,i,j,k,c;
for(k=0;k<10;k++){
scanf("%lld%lld%lld",&a,&b,&c);
res=a%c;
res=(res*b)%c;
printf("%lld\n",res);
}
return 0;
}
D.O.P.E Online Judge! prob:-Complement
–AC–
#include<stdio.h>
int main(){long long n,t,b,c;while(1){if(scanf("%lld",&n)==-1) break;
t=n;c=0;while(1){t>>=1;if(t==0) break;++c;}c+=1;n=~n;b=0;b=~b;b<<=c;
b=~b;n=n&b;printf("%lld\n",n);}return 0;}
Recent Comments