Skip to content
Discussion options

You must be logged in to vote

We need to find the maximum possible minimum power across all cities after optimally placing k additional power stations.

Approach:

  1. Understanding the power calculation: Each power station at position i provides power to all cities within [i-r, i+r]. So the power of a city is the sum of all stations that can reach it.

  2. Key insight: This is a classic "maximize the minimum" problem, which suggests using binary search. I'll binary search on the possible minimum power values.

  3. Preprocessing: First, I need to calculate the initial power for each city. I can use a prefix sum/difference array technique to efficiently compute how many stations cover each city.

  4. Checking feasibility: For a can…

Replies: 1 comment 2 replies

Comment options

mah-shamim
Nov 7, 2025
Maintainer Author

You must be logged in to vote
2 replies
@kovatz
Comment options

kovatz Nov 7, 2025
Collaborator

@mah-shamim
Comment options

mah-shamim Nov 7, 2025
Maintainer Author

Answer selected by kovatz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested hard Difficulty
2 participants