全部评论 3


  • num>=m

    3天前 来自 河北

    0
  • #include <bits/stdc++.h>
    using namespace std;
    stack <string> stk;
    int n,m;
    string us;
    string post;
    int main() {
    	cin >> n >> m;
    	int num=0;
    	while (n--) {
    		cin >> us;
    		if (us=="C") {
    			cin >> post;
    			stk.push(post);
    			if (num>=stk.size())continue;
    			num++;
    		} else  if (us=="Q"&&stk.empty()) {
    			cout << "Everyone, come and deliver it." << endl;
    		} else if (us=="Q"&&stk.size()>0) {
    			cout << stk.top() << endl;
    			stk.pop();
    			num--;
    		}
    
    	}
    	return 0;
    }
    

    3天前 来自 河北

    0
  • 3天前 来自 河北

    0

热门讨论