Skip to content
Snippets Groups Projects

Refactor algorithms and add some stuff

Merged Bruno Freitas Tissei requested to merge refactor into master
9 files
+ 389
23
Compare changes
  • Side-by-side
  • Inline
Files
9
@@ -25,13 +25,15 @@
* [x1 x2]^n
* [ 1 0]
*/
matrix solve(ll x, ll y, ll n) {
matrix in(2);
template <typename T>
matrix<T> solve(ll x, ll y, ll n) {
matrix<T> in(2);
// Example
in[0][0] = x % MOD;
in[0][1] = y % MOD;
in[1][0] = 1;
in[1][1] = 0;
return fast_pow(in, n);
return fast_pow<T>(in, n);
}
Loading