摘要:        
先放代码: class Solution { public: class mycomperation { public://注意这里的问题 bool operator()(const pair<int, int>& lhs, const pair<int, int>& rhs) { return l    阅读全文
        
            posted @ 2024-11-20 15:52
小橘0815
阅读(13)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
第一版代码: class Solution { private: class MyQueue { //单调队列(从大到小) public: deque<int> que; // 使用deque来实现单调队列 // 每次弹出的时候,比较当前要弹出的数值是否等于队列出口元素的数值,如果相等则弹出。 //    阅读全文
        
            posted @ 2024-11-20 11:21
小橘0815
阅读(21)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
首先是第一次的代码 class Solution { public: int evalRPN(vector<string> &tokens) { stack<long long> str; for (int i = 0; i < tokens.size(); i++) { if (tokens[i]    阅读全文
        
            posted @ 2024-11-18 22:46
小橘0815
阅读(17)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
第一版的代码如下下: 点击查看代码 class Solution { public: string removeDuplicates(string s) { stack<char> str; for (int i = 0; i < s.size(); i++) { //要先判断才能进行压栈,再次记住    阅读全文
        
            posted @ 2024-11-17 11:49
小橘0815
阅读(38)
评论(0)
推荐(0)
        
        
 
                    
                     
                    
                 
                    
                 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号