diff options
| author | mzuenni <michi.zuendorf@gmail.com> | 2024-08-06 16:54:13 +0200 |
|---|---|---|
| committer | mzuenni <michi.zuendorf@gmail.com> | 2024-08-06 16:54:13 +0200 |
| commit | 19436370fb48bc0a5e356d1ba713dc39b1a35d3a (patch) | |
| tree | 42124647e993b50bc2b8af36090a0b0245a63992 | |
| parent | d88debc398f18d4e3d1c53d221dffe3981f35e41 (diff) | |
upper case INF
| -rw-r--r-- | content/datastructures/dynamicConvexHull.cpp | 2 | ||||
| -rw-r--r-- | content/datastructures/lazyPropagation.cpp | 2 | ||||
| -rw-r--r-- | content/datastructures/lichao.cpp | 4 | ||||
| -rw-r--r-- | content/geometry/hpi.cpp | 2 | ||||
| -rw-r--r-- | content/other/divideAndConquer.cpp | 4 | ||||
| -rw-r--r-- | content/other/knuth.cpp | 2 | ||||
| -rw-r--r-- | tcr.pdf | bin | 691129 -> 691160 bytes | |||
| -rw-r--r-- | test/datastructures/dynamicConvexHull.lichao.cpp | 1 | ||||
| -rw-r--r-- | test/datastructures/lazyPropagation.cpp | 2 | ||||
| -rw-r--r-- | test/datastructures/lichao.cpp | 4 | ||||
| -rw-r--r-- | test/other/divideAndConquer.cpp | 8 | ||||
| -rw-r--r-- | test/other/knuth.cpp | 8 |
12 files changed, 19 insertions, 20 deletions
diff --git a/content/datastructures/dynamicConvexHull.cpp b/content/datastructures/dynamicConvexHull.cpp index dfcfe0b..27ec898 100644 --- a/content/datastructures/dynamicConvexHull.cpp +++ b/content/datastructures/dynamicConvexHull.cpp @@ -5,7 +5,7 @@ struct Line { }; struct HullDynamic : multiset<Line, less<>> { // max über Geraden - // (for doubles, use inf = 1/.0, div(a,b) = a/b) + // (for doubles, use INF = 1/.0, div(a,b) = a/b) ll div(ll a, ll b) {return a / b - ((a ^ b) < 0 && a % b);} bool isect(iterator x, iterator y) { diff --git a/content/datastructures/lazyPropagation.cpp b/content/datastructures/lazyPropagation.cpp index 441590e..ab91364 100644 --- a/content/datastructures/lazyPropagation.cpp +++ b/content/datastructures/lazyPropagation.cpp @@ -2,7 +2,7 @@ struct SegTree { using T = ll; using U = ll; int n; static constexpr T E = 0; // Neutral element for combine - static constexpr U UF = inf; // Unused value by updates + static constexpr U UF = INF; // Unused value by updates vector<T> tree; int h; vector<U> lazy; diff --git a/content/datastructures/lichao.cpp b/content/datastructures/lichao.cpp index 646ad68..1318ca7 100644 --- a/content/datastructures/lichao.cpp +++ b/content/datastructures/lichao.cpp @@ -8,7 +8,7 @@ struct Fun { // Default: Linear function. Change as needed. // Default: Computes min. Change lines with comment for max. struct Lichao { - static constexpr Fun id = {0, inf}; // {0, -inf} + static constexpr Fun id = {0, INF}; // {0, -INF} int n, cap; vector<Fun> seg; Lichao() : n(sz(xs)), cap(2 << __lg(n)), seg(2 * cap, id) {} @@ -36,7 +36,7 @@ struct Lichao { } ll _query(int x) { - ll ans = inf; // -inf + ll ans = INF; // -INF for (int i = x + cap; i > 0; i /= 2) { ans = min(ans, seg[i](x)); // max } diff --git a/content/geometry/hpi.cpp b/content/geometry/hpi.cpp index 3509e0e..bd3ab1e 100644 --- a/content/geometry/hpi.cpp +++ b/content/geometry/hpi.cpp @@ -1,4 +1,4 @@ -constexpr ll inf = 0x1FFF'FFFF'FFFF'FFFF;//THIS CODE IS WIP +constexpr ll INF = 0x1FFF'FFFF'FFFF'FFFF;//THIS CODE IS WIP bool left(pt p) {return real(p) < 0 || (real(p) == 0 && imag(p) < 0);} diff --git a/content/other/divideAndConquer.cpp b/content/other/divideAndConquer.cpp index 830dc7f..9bd5f0c 100644 --- a/content/other/divideAndConquer.cpp +++ b/content/other/divideAndConquer.cpp @@ -5,7 +5,7 @@ void rec(int i, int j0, int j1, int m0, int m1) { if (j1 < j0) return; int jmid = (j0 + j1) / 2; - dp[i][jmid] = inf; + dp[i][jmid] = INF; int bestk = m0; for (int k = m0; k < min(jmid, m1 + 1); ++k) { if (dp[i - 1][k] + C[k + 1][jmid] < dp[i][jmid]) { @@ -18,7 +18,7 @@ void rec(int i, int j0, int j1, int m0, int m1) { } ll calc(int n, int m) { - dp = vector<vector<ll>>(m, vector<ll>(n, inf)); + dp = vector<vector<ll>>(m, vector<ll>(n, INF)); for (int i = 0; i < n; i++) dp[0][i] = C[0][i]; for (int i = 1; i < m; i++) { rec(i, 0, n - 1, 0, n - 1); diff --git a/content/other/knuth.cpp b/content/other/knuth.cpp index 1d513c8..aa54924 100644 --- a/content/other/knuth.cpp +++ b/content/other/knuth.cpp @@ -1,5 +1,5 @@ ll calc(int n, int m, const vector<vector<ll>>& C) { - vector<vector<ll>> dp(m, vector<ll>(n, inf)); + vector<vector<ll>> dp(m, vector<ll>(n, INF)); vector<vector<int>> opt(m, vector<int>(n + 1, n - 1)); for (int i = 0; i < n; i++) dp[0][i] = C[0][i]; Binary files differdiff --git a/test/datastructures/dynamicConvexHull.lichao.cpp b/test/datastructures/dynamicConvexHull.lichao.cpp index 6ab55f0..d50ca60 100644 --- a/test/datastructures/dynamicConvexHull.lichao.cpp +++ b/test/datastructures/dynamicConvexHull.lichao.cpp @@ -1,6 +1,5 @@ #include "../util.h" constexpr ll INF = LL::INF; -constexpr ll inf = LL::INF; #include <datastructures/dynamicConvexHull.cpp> #include <datastructures/lichao.cpp> diff --git a/test/datastructures/lazyPropagation.cpp b/test/datastructures/lazyPropagation.cpp index 7002061..feb07f0 100644 --- a/test/datastructures/lazyPropagation.cpp +++ b/test/datastructures/lazyPropagation.cpp @@ -1,5 +1,5 @@ #include "../util.h" -constexpr ll inf = LL::INF; +constexpr ll INF = LL::INF; #include <datastructures/lazyPropagation.cpp> constexpr int N = 1000'000; diff --git a/test/datastructures/lichao.cpp b/test/datastructures/lichao.cpp index c8a56a3..f4b797b 100644 --- a/test/datastructures/lichao.cpp +++ b/test/datastructures/lichao.cpp @@ -1,5 +1,5 @@ #include "../util.h" -constexpr ll inf = LL::INF; +constexpr ll INF = LL::INF; #include <datastructures/lichao.cpp> void stress_test(ll range) { @@ -9,7 +9,7 @@ void stress_test(ll range) { xs = Random::distinct<ll>(n, -range, range); sort(all(xs)); - vector<ll> naive(n, inf); + vector<ll> naive(n, INF); Lichao tree; for (int operations = 0; operations < 1000; operations++) { diff --git a/test/other/divideAndConquer.cpp b/test/other/divideAndConquer.cpp index a6fda9d..6d1b444 100644 --- a/test/other/divideAndConquer.cpp +++ b/test/other/divideAndConquer.cpp @@ -1,5 +1,5 @@ #include "../util.h" -constexpr ll inf = LL::INF; +constexpr ll INF = LL::INF; #include <other/divideAndConquer.cpp> vector<vector<ll>> gen(int n) { @@ -43,7 +43,7 @@ vector<vector<ll>> genQuick(int n) { } /*ll naive(int n, int m) { - vector<vector<ll>> state(m+1, vector<ll>(n+1, inf)); + vector<vector<ll>> state(m+1, vector<ll>(n+1, INF)); state[0][0] = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= n; j++) { @@ -56,9 +56,9 @@ vector<vector<ll>> genQuick(int n) { }*/ vector<ll> naive(int n) { - vector<vector<ll>> state(n+1, vector<ll>(n+1, inf)); + vector<vector<ll>> state(n+1, vector<ll>(n+1, INF)); state[0][0] = 0; - vector<ll> res(n+1, inf); + vector<ll> res(n+1, INF); for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { for (int k = 1; k <= j; k++) { diff --git a/test/other/knuth.cpp b/test/other/knuth.cpp index d469ceb..3462c0a 100644 --- a/test/other/knuth.cpp +++ b/test/other/knuth.cpp @@ -1,5 +1,5 @@ #include "../util.h" -constexpr ll inf = LL::INF; +constexpr ll iINFnf = LL::INF; #include <other/knuth.cpp> vector<vector<ll>> gen(int n) { @@ -43,7 +43,7 @@ vector<vector<ll>> genQuick(int n) { } /*ll naive(int n, int m, const vector<vector<ll>>& C) { - vector<vector<ll>> state(m+1, vector<ll>(n+1, inf)); + vector<vector<ll>> state(m+1, vector<ll>(n+1, INF)); state[0][0] = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= n; j++) { @@ -56,9 +56,9 @@ vector<vector<ll>> genQuick(int n) { }*/ vector<ll> naive(int n, const vector<vector<ll>>& C) { - vector<vector<ll>> state(n+1, vector<ll>(n+1, inf)); + vector<vector<ll>> state(n+1, vector<ll>(n+1, INF)); state[0][0] = 0; - vector<ll> res(n+1, inf); + vector<ll> res(n+1, INF); for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { for (int k = 1; k <= j; k++) { |
