Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Matr P[35];
- Matr power(Matr A, int p) {
- Matr x = IdMatr;
- x.m = x.n = A.m;
- int i = 0;
- while(p > 0) {
- if(p % 2) x = x * P[i];
- i++;
- p /= 2;
- }
- re x;
- }
- // ....
- // in main()...
- P[0] = Gen;
- FOR(i,1,34)
- P[i] = P[i-1] * P[i-1];
- // ....
Add Comment
Please, Sign In to add comment