Skip to content

Commit a7269c3

Browse files
authored
Fix self-divisible condition in permutation calculation
1 parent ebb7b79 commit a7269c3

File tree

1 file changed

+1
-1
lines changed
  • solution/2900-2999/2992.Number of Self-Divisible Permutations

1 file changed

+1
-1
lines changed

solution/2900-2999/2992.Number of Self-Divisible Permutations/Solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def dfs(mask: int) -> int:
77
return 1
88
ans = 0
99
for j in range(1, n + 1):
10-
if (mask >> j & 1) == 0 and (i % j == 0 or j % i == 0):
10+
if (mask >> j & 1) == 0 and gcd(i, j) == 1:
1111
ans += dfs(mask | 1 << j)
1212
return ans
1313

0 commit comments

Comments
 (0)