summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/lgsFp.cpp2
-rw-r--r--math/permIndex.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/math/lgsFp.cpp b/math/lgsFp.cpp
index 29ec849..7dcd354 100644
--- a/math/lgsFp.cpp
+++ b/math/lgsFp.cpp
@@ -12,7 +12,7 @@ void takeAll(int n, int line, ll p) {
mat[i][j] = (mat[i][j] + p) % p;
}}}
-void gauss(int n, ll mod) { // Nx(N+1)-Matrix, Körper F_p.
+void gauss(int n, ll mod) {
vector<bool> done(n, false);
for (int i = 0; i < n; i++) {
int j = 0;
diff --git a/math/permIndex.cpp b/math/permIndex.cpp
index 09ff7f7..4cffc12 100644
--- a/math/permIndex.cpp
+++ b/math/permIndex.cpp
@@ -6,9 +6,8 @@ ll permIndex(vector<ll> v) {
x = t.order_of_key(x);
}
ll res = 0;
- for (ll i = sz(v); i > 0; i--) {
- res *= i;
- res += v[i - 1];
+ for (int i = sz(v); i > 0; i--) {
+ res = res * i + v[i - 1];
}
return res;
}