White Cloud has built n stores numbered from 1 to n.White Rabbit wants to visit these stores in the order from 1 to n.The store numbered i has a price a[i] representing that White Rabbit can spend a[i] dollars to buy a product or sell a product to get a[i] dollars when it is in the i-th store.The product is too heavy so that White Rabbit can only take one product at the same time.White Rabbit wants to know the maximum profit after visiting all stores.Also, White Rabbit wants to know the minimum number of transactions while geting the maximum profit.Notice that White Rabbit has infinite money initially.
White Cloud has built n stores numbered from 1 to n. White Rabbit wants to visit these stores in the order from 1 to n. The store numbered i has a price a[i] representing that White Rabbit can spend a[i] dollars to buy a product or sell a product to get a[i] dollars when it is in the i-th store. The product is too heavy so that White Rabbit can only take one product at the same time. White Rabbit wants to know the maximum profit after visiting all stores. Also, White Rabbit wants to know the minimum number of transactions while geting the maximum profit. Notice that White Rabbit has infinite money initially.
标签: HBC16632money题解