import java.util.ArrayList; public class MyStack { private ArrayList<Object> arrayList; public MyStack() { arrayList = new ArrayList<>(); } public void pop(Object o) { arrayList.add(o); } public Object myRamove() { int size = arrayList.size();…
思路:刚开始用STL中的栈,一直RE……,之后改为手动模拟栈操作,在注意点细节就可以了!!! 代码如下: #include<cstdio> #include<cstring> #include<algorithm> #define M 1000001 using namespace std; int A[M],B[M],a[M],s[M],cur,x,q,l,r; char c; int main() { while(scanf("%d",&…