Skip to content

Commit 1b65e49

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 683a447 commit 1b65e49

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

content/5_Plat/PIE.mdx

+2-5
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ int howMany(vector<string> patterns, int k) {
264264
265265
int ans = 0;
266266
for (int mask = 0; mask < (1 << n); mask++) {
267-
if (__builtin_popcount(mask) == k) {
268-
ans = (ans + dp[m - 1][mask]) % MOD;
269-
}
267+
if (__builtin_popcount(mask) == k) { ans = (ans + dp[m - 1][mask]) % MOD; }
270268
}
271269
272270
return ans;
@@ -313,8 +311,7 @@ int howMany(vector<string> patterns, int k) {
313311
// subsets with exactly k patterns matters
314312
if (__builtin_popcount(mask) != k) { continue; }
315313
// iterate over all superset of current subset mask
316-
for (int supermask = mask; supermask < (1 << n);
317-
supermask++) {
314+
for (int supermask = mask; supermask < (1 << n); supermask++) {
318315
if ((mask & supermask) != mask) { continue; }
319316
int sign = ((__builtin_popcount(supermask) - k) & 1 ? -1 : 1);
320317
int freq = 1; // checks how many valid strings satisfy the supermask

0 commit comments

Comments
 (0)