diff --git a/1599-240101-pass/main.cpp b/1599-240101-pass/main.cpp new file mode 100644 index 0000000..9c82e6a --- /dev/null +++ b/1599-240101-pass/main.cpp @@ -0,0 +1,77 @@ +#include +using namespace std; +class Solution { +public: + int minOperationsMaxProfit(vector& customers, int boardingCost, int runningCost) { + if(boardingCost * 4 < runningCost) return -1; + int waiting = 0; + int profit = 0; + int max_profit= -1; + int wheel = 0; + int ans = wheel; + for(int i = 0 ; i < customers.size();i++){ + waiting += customers[i]; + if(waiting <= 4){ + profit += waiting * boardingCost - runningCost; + waiting = 0; + }else{ + profit += 4 * boardingCost - runningCost; + waiting -= 4; + } + cout< customer_ex1 = {8,3}; + int boardingCost = 5, runningCost = 6; + cout< customer_ex2 = {10,9,6}; + boardingCost = 6, runningCost = 4; + cout< customer_ex3 = {3,4,0,5,1}; + boardingCost = 1, runningCost = 92; + cout< customer_ex4 = {2}; + boardingCost = 2, runningCost = 4; + cout<