From 7f385250143d9e490e1adc67b3eef28a9ce17878 Mon Sep 17 00:00:00 2001 From: Luke Videckis Date: Wed, 18 Mar 2026 11:17:56 -0600 Subject: [PATCH] minor golf --- content/data-structures/FenwickTree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/data-structures/FenwickTree.h b/content/data-structures/FenwickTree.h index 7caa5f512..c3becb233 100644 --- a/content/data-structures/FenwickTree.h +++ b/content/data-structures/FenwickTree.h @@ -27,7 +27,7 @@ struct FT { int pos = 0; for (int pw = 1 << 25; pw; pw >>= 1) { if (pos + pw <= sz(s) && s[pos + pw-1] < sum) - pos += pw, sum -= s[pos-1]; + sum -= s[(pos+=pw)-1]; } return pos; }