摘要:
1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int Maxlen=1e5; 7 int prices[Maxlen]; 8 int n,k; 9 10 int quickSolve(){ 11 //as long as there is a price gap ,we g... 阅读全文
摘要:
1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int Maxlen=1e5; 7 const int INF = 0x3f3f3f; 8 const int _INF = -0x3f3f3f; 9 10 int main(){ 11 12 //局部最优解 和 全局最... 阅读全文
摘要:
Best Time to Buy and Sell Stock III 给定每一天的股票价格(用 price数组来存储) 限定条件是至多只能交易两次交易(一次买卖为一次交易) #include <algorithm> #include <iostream> #include <string.h> u 阅读全文