报个微软OA

Merge three stacks into one.

s1 = -5,1,2,3,5
s2 = -3,4,6,7
s3 = 1,5

output (return one stack)
-5,-3,1,1,2,3,4,5,5,6,7

Given an array of distances called D, and you have a car traveling at speed X. you have limited number of speedups you can take by a factor of 17% or 34% or combined those 2 factors (the speedup only lasts for the segment the speedup is activated on). Array C of length 2 tells you the number of speedups available for each factor. variable S tells you the base speed. what is the shortest time you need to cover the distances.

Also when calculating the time to cover a particular distance, you round up the result to nearest integer.
How could I avoid a bruteforce solution because I ended up trying all possible combinations of speedups and paths thus taking exponential amount of time.

int shortest_time(vector<int>& D, vector<int>& C, int S){
}