We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#define ll long long int#define mod %1000000007llfastexpo(lla,lln){llret=1;llb=a;while(n){if(n&1)ret=(ret*b)mod;//if(n==odd) b=(b*b)mod;n>>=1;// n/=2}return(ll)ret;}
Matrix Tracing
You are viewing a single comment's thread. Return to all comments →
Prerequisites to solve this problem
1.fast exponentiation
2.X^(-1) mod(p) can be written as X^(p-2) mod(p)