summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/datastructures/persistent.cpp2
-rw-r--r--content/geometry/polygon.cpp2
-rw-r--r--content/graph/cycleCounting.cpp2
-rw-r--r--content/math/sqrtModCipolla.cpp2
-rw-r--r--content/string/suffixArray.cpp2
5 files changed, 5 insertions, 5 deletions
diff --git a/content/datastructures/persistent.cpp b/content/datastructures/persistent.cpp
index 9f38806..ed2f891 100644
--- a/content/datastructures/persistent.cpp
+++ b/content/datastructures/persistent.cpp
@@ -7,7 +7,7 @@ struct persistent {
: time(time), data(1, {2*time, value}) {}
T get(int t) {
- return prev(ranges::upper_bound(data,pair{2*t+1, T{}}))->second;
+ return ranges::upper_bound(data,pair{2*t+1, T{}})[-1].second;
}
int set(T value) {
diff --git a/content/geometry/polygon.cpp b/content/geometry/polygon.cpp
index 626162a..9c90534 100644
--- a/content/geometry/polygon.cpp
+++ b/content/geometry/polygon.cpp
@@ -66,7 +66,7 @@ vector<pt> minkowski(vector<pt> ps, vector<pt> qs) {
ps.push_back(ps[1]);
qs.push_back(qs[1]);
vector<pt> res;
- for (ll i = 0, j = 0; i + 2 < ssize(ps) || j + 2 < ssize(qs);) {
+ for (ll i = 0, j = 0; i+2 < ssize(ps) || j+2 < ssize(qs);) {
res.push_back(ps[i] + qs[j]);
auto c = cross(ps[i + 1] - ps[i], qs[j + 1] - qs[j]);
if(c >= 0) i++;
diff --git a/content/graph/cycleCounting.cpp b/content/graph/cycleCounting.cpp
index 65bf1a0..deac71e 100644
--- a/content/graph/cycleCounting.cpp
+++ b/content/graph/cycleCounting.cpp
@@ -36,7 +36,7 @@ struct cycles {
cur[id].flip();
}}}
- bool isCycle(cycle cur) { // cycle must be constrcuted from base
+ bool isCycle(cycle cur) {// cycle must be constructed from base
if (cur.none()) return false;
init(ssize(adj)); // union find @\sourceref{datastructures/unionFind.cpp}@
for (int i = 0; i < ssize(edges); i++) {
diff --git a/content/math/sqrtModCipolla.cpp b/content/math/sqrtModCipolla.cpp
index d52d258..c062646 100644
--- a/content/math/sqrtModCipolla.cpp
+++ b/content/math/sqrtModCipolla.cpp
@@ -1,4 +1,4 @@
-ll sqrtMod(ll a, ll p) { // teste mit Legendre ob Lösung existiert
+ll sqrtMod(ll a, ll p) {// teste mit Legendre ob Lösung existiert
if (a < 2) return a;
ll t = 0;
while (legendre((t*t-4*a) % p, p) >= 0) t = rng() % p;
diff --git a/content/string/suffixArray.cpp b/content/string/suffixArray.cpp
index c49bdc9..65bbb38 100644
--- a/content/string/suffixArray.cpp
+++ b/content/string/suffixArray.cpp
@@ -31,7 +31,7 @@ struct SuffixArray {
int lcp(int x, int y) {
if (x == y) return n - x;
int res = 0;
- for (int i = ssize(P) - 1; i >= 0 && max(x, y) + res < n; i--) {
+ for (int i = ssize(P)-1; i >= 0 && max(x, y) + res < n; i--){
if (P[i][x + res] == P[i][y + res]) res |= 1 << i;
}
return res;