Problem · Graph
Drop-Off Centers
Learn this problemProblem statement
Each graph node is a potential drop-off center owned by one company. A contracted company contributes all of its centers. Count non-empty company subsets for which every pair of selected centers is at least minDistance apart by shortest-road distance.
Function
findCount(n: int, graphFrom: int[], graphTo: int[], graphWeight: int[], minDistance: int, company: int[]) → intExamples
Example 1
n = 3graphFrom = [1,2,3]graphTo = [2,3,1]graphWeight = [3,2,5]minDistance = 4company = [1,2,3]return = 4The valid subsets are each singleton and companies 1 with 3.
Constraints
2 <= n <= 10001 <= edges <= n(n-1)/21 <= edge weight, minDistance <= 1001 <= companies <= 10- There is at most one road between a node pair.
More Atlassian problems
- Planning ProductionOA · Seen Feb 2025
- K-Means ClusteringOA · Seen Feb 2025
- Minimum Sorted Erasure OperationsOA · Seen Jun 2024
- Count Analogous ArraysOA · Seen Mar 2024
- Get Maximum ScoreOA · Seen Mar 2024
- Better Compression 🦀OA · Seen Mar 2024
- Romanizer 🐡OA · Seen Mar 2024
- Flower Bouquets 💐OA · Seen Mar 2024