题目详情 - L3-002 特殊堆栈 (30 分) (pintia.cn)
Vector
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
int n, x;
string op;
vector<int> res;
stack<int> st;
void Push(int x)
{
auto pos = lower_bound(res.begin(), res.end(), x);
res.insert(pos, x);
}
int Pop(int x)
{
auto pos = lower_bound(res.begin(), res.end(), x);
res.erase(pos);
}
int Get()
{
if(res.size() & 1) return res[(res.size() + 1) / 2 - 1];
return res[res.size() / 2 - 1];
}
int main()
{
// ios::sync_with_stdio(false);
cin >> n;
for(int i = 0; i < n; i ++ )
{
cin >> op;
if(op &#