MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / power

Function power

Math/Determinant under Prime Modulo.cpp:6–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4const int N = 105, mod = 998244353;
5
6int power(long long n, long long k) {
7 int ans = 1 % mod; n %= mod; if (n < 0) n += mod;
8 while (k) {
9 if (k & 1) ans = (long long) ans * n % mod;
10 n = (long long) n * n % mod;
11 k >>= 1;
12 }
13 return ans;
14}
15int Gauss(vector<vector<int>> a) {
16 int n = a.size(), m = (int)a[0].size();
17 int free_var = 0;

Callers 1

GaussFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected