Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 20, 2024
1 parent 068df15 commit 4523edd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions solutions/bronze/cf-863B.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,22 @@ w = list(map(int, input().split()))

w.sort()

res = 10 ** 9
res = 10**9

# loop through all possible combinations of people in the single kayaks
for i in range(0, 2 * n):
for j in range(i + 1, 2 * n):
for j in range(i + 1, 2 * n):

# list 's' will store the weights of the people who need to be placed in tandem kayaks
s = [w[k] for k in range(0, 2 * n) if k != i and k != j]
# list 's' will store the weights of the people who need to be placed in tandem kayaks
s = [w[k] for k in range(0, 2 * n) if k != i and k != j]

temp = 0
temp = 0

# calculating instability
for k in range(0, 2 * n - 2, 2):
temp += s[k + 1] - s[k]
res = min(res, temp)
# calculating instability
for k in range(0, 2 * n - 2, 2):
temp += s[k + 1] - s[k]

res = min(res, temp)

print(res)
```
Expand Down

0 comments on commit 4523edd

Please sign in to comment.