summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormzuenni <michi.zuendorf@gmail.com>2026-10-17 17:48:22 +0200
committermzuenni <michi.zuendorf@gmail.com>2026-10-17 17:48:22 +0200
commitd39aa7ca41379e81b0b873d26186f4ab128ffe04 (patch)
tree51e8655c0904667c57855d2162ad9ea012d23ecb
parentcf4b381136961c321eb0e2140a954a74341d5f2c (diff)
++i -> ++i
-rw-r--r--content/math/bigint.cpp16
-rw-r--r--content/math/transforms/fft.cpp2
-rw-r--r--content/other/divideAndConquer.cpp2
-rw-r--r--content/other/knuth.cpp2
4 files changed, 11 insertions, 11 deletions
diff --git a/content/math/bigint.cpp b/content/math/bigint.cpp
index 1b3b953..6ba03ff 100644
--- a/content/math/bigint.cpp
+++ b/content/math/bigint.cpp
@@ -22,7 +22,7 @@ struct bigint {
bigint operator+(const bigint& v) const {
if (sign == v.sign) {
bigint res = v;
- for (ll i = 0, carry = 0; i < max(sz(a), sz(v.a)) || carry; ++i) {
+ for (ll i = 0, carry = 0; i < max(sz(a), sz(v.a)) || carry; i++) {
if (i == sz(res.a))
res.a.push_back(0);
res.a[i] += carry + (i < sz(a) ? a[i] : 0);
@@ -39,7 +39,7 @@ struct bigint {
if (sign == v.sign) {
if (abs() >= v.abs()) {
bigint res = *this;
- for (ll i = 0, carry = 0; i < sz(v.a) || carry; ++i) {
+ for (ll i = 0, carry = 0; i < sz(v.a) || carry; i++) {
res.a[i] -= carry + (i < sz(v.a) ? v.a[i] : 0);
carry = res.a[i] < 0;
if (carry) res.a[i] += base;
@@ -54,7 +54,7 @@ struct bigint {
void operator*=(ll v) {
if (v < 0) sign = -sign, v = -v;
- for (ll i = 0, carry = 0; i < sz(a) || carry; ++i) {
+ for (ll i = 0, carry = 0; i < sz(a) || carry; i++) {
if (i == sz(a)) a.push_back(0);
ll cur = a[i] * v + carry;
carry = cur / base;
@@ -82,7 +82,7 @@ struct bigint {
ll s2 = sz(r.a) <= sz(b.a) - 1 ? 0 : r.a[sz(b.a) - 1];
ll d = (base * s1 + s2) / b.a.back();
r -= b * d;
- while (r < 0) r += b, --d;
+ while (r < 0) r += b, d--;
q.a[i] = d;
}
q.sign = a1.sign * b1.sign;
@@ -102,7 +102,7 @@ struct bigint {
void operator/=(ll v) {
if (v < 0) sign = -sign, v = -v;
- for (ll i = sz(a) - 1, rem = 0; i >= 0; --i) {
+ for (ll i = sz(a) - 1, rem = 0; i >= 0; i--) {
ll cur = a[i] + rem * base;
a[i] = cur / v;
rem = cur % v;
@@ -119,7 +119,7 @@ struct bigint {
ll operator%(ll v) const {
if (v < 0) v = -v;
ll m = 0;
- for (ll i = sz(a) - 1; i >= 0; --i)
+ for (ll i = sz(a) - 1; i >= 0; i--)
m = (a[i] + m * base) % v;
return m * sign;
}
@@ -197,7 +197,7 @@ struct bigint {
ll pos = 0;
while (pos < sz(s) && (s[pos] == '-' || s[pos] == '+')) {
if (s[pos] == '-') sign = -sign;
- ++pos;
+ pos++;
}
for (ll i = sz(s) - 1; i >= pos; i -= base_digits) {
ll x = 0;
@@ -218,7 +218,7 @@ struct bigint {
friend ostream& operator<<(ostream& stream, const bigint& v) {
if (v.sign == -1) stream << '-';
stream << (v.a.empty() ? 0 : v.a.back());
- for (ll i = sz(v.a) - 2; i >= 0; --i)
+ for (ll i = sz(v.a) - 2; i >= 0; i--)
stream << setw(base_digits) << setfill('0') << v.a[i];
return stream;
}
diff --git a/content/math/transforms/fft.cpp b/content/math/transforms/fft.cpp
index 2bd95b2..fbbcc07 100644
--- a/content/math/transforms/fft.cpp
+++ b/content/math/transforms/fft.cpp
@@ -2,7 +2,7 @@ using cplx = complex<double>;
void fft(vector<cplx>& a, bool inv = false) {
int n = sz(a);
- for (int i = 0, j = 1; j < n - 1; ++j) {
+ for (int i = 0, j = 1; j < n - 1; j++) {
for (int k = n >> 1; k > (i ^= k); k >>= 1);
if (j < i) swap(a[i], a[j]);
}
diff --git a/content/other/divideAndConquer.cpp b/content/other/divideAndConquer.cpp
index 9bd5f0c..18a7b51 100644
--- a/content/other/divideAndConquer.cpp
+++ b/content/other/divideAndConquer.cpp
@@ -7,7 +7,7 @@ void rec(int i, int j0, int j1, int m0, int m1) {
dp[i][jmid] = INF;
int bestk = m0;
- for (int k = m0; k < min(jmid, m1 + 1); ++k) {
+ for (int k = m0; k < min(jmid, m1 + 1); k++) {
if (dp[i - 1][k] + C[k + 1][jmid] < dp[i][jmid]) {
dp[i][jmid] = dp[i - 1][k] + C[k + 1][jmid];
bestk = k;
diff --git a/content/other/knuth.cpp b/content/other/knuth.cpp
index aa54924..0f34824 100644
--- a/content/other/knuth.cpp
+++ b/content/other/knuth.cpp
@@ -4,7 +4,7 @@ ll calc(int n, int m, const vector<vector<ll>>& C) {
for (int i = 0; i < n; i++) dp[0][i] = C[0][i];
for (int i = 1; i < m; i++) {
- for (int j = n - 1; j >= 0; --j) {
+ for (int j = n - 1; j >= 0; j--) {
opt[i][j] = i == 1 ? 0 : opt[i - 1][j];
for (int k = opt[i][j]; k <= min(opt[i][j+1], j-1); k++) {
if (dp[i][j] <= dp[i - 1][k] + C[k + 1][j]) continue;