-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Computing a raised to b mod c in logn time #108
Conversation
@yashagarwal1999 Give proper indentation to the code |
Added Indentation to the code |
return r; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No space required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yashagarwal1999 Please make correct indentation.
cin>>a>>b>>c; | ||
ll ans=fast_power(a,b,c); | ||
cout<<ans<<endl; | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra space
ll fast_power(ll n, ll k, ll p = MOD) { | ||
ll r = 1; | ||
for (; k; k >>= 1) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra space
ll r = 1; | ||
for (; k; k >>= 1) | ||
{ | ||
if (k & 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 line space after bracket.
using namespace std; | ||
|
||
ll fast_power(ll n, ll k, ll p = MOD) { | ||
ll r = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No indentation.
Solved
close #101