Back to problems

Maximum Profit Query Selection

Algorithm · Snowflake · Easy

Query Selection You are operating a virtual data warehouse with n query types. Each type has a fixed execution time and a fixed profit. You may select exactly one type, then run that same type repeatedly within a total time budget of k minutes. Your task is to choose the type that gives the highest total profit. For type i, with execution time durations[i] and per-run profit revenues[i], the number of runs that fit in k minutes is k / durations[i] using integer division. If…

Checking your access…