Tap here to switch tabs
Problem
Submissions

Problem: Minimum Total Price After Applying Discounts

Minimum Total Price After Applying Discounts gives item prices and percentage discounts. Apply at most one discount to each item, use each discount at most once, and return the minimum total price.

Statement

You are given two integer arrays, prices and discounts.

Each element in discounts represents a percentage discount. You may apply at most one discount to each item in prices, and each discount from discounts can be applied to at most one item.

Applying a discount of dd percent to an item with price pp reduces its price to:

Return the minimum possible total price of all items after applying the discounts optimally, rounded to five decimal places.

Constraints:

  • 1≤1 ≤ prices.length, discounts.length ≤1000≤ 1000

  • 1≤1 ≤ prices[i] ≤10000≤ 10000

  • 0≤0 ≤ discounts[i] ≤100≤ 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Total Price After Applying Discounts

Minimum Total Price After Applying Discounts gives item prices and percentage discounts. Apply at most one discount to each item, use each discount at most once, and return the minimum total price.

Statement

You are given two integer arrays, prices and discounts.

Each element in discounts represents a percentage discount. You may apply at most one discount to each item in prices, and each discount from discounts can be applied to at most one item.

Applying a discount of dd percent to an item with price pp reduces its price to:

Return the minimum possible total price of all items after applying the discounts optimally, rounded to five decimal places.

Constraints:

  • 1≤1 ≤ prices.length, discounts.length ≤1000≤ 1000

  • 1≤1 ≤ prices[i] ≤10000≤ 10000

  • 0≤0 ≤ discounts[i] ≤100≤ 100