题目链接: Joint Stacks Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description A stack is a data structure in which all insertions and deletions of entries are made at one end, called the "top" of the…
https://vjudge.net/problem/HDU-5818 题意:给你两个栈AB,有常规push,pop操作,以及一个merge操作,merge A B 即将A.B的元素按照入栈顺序全部出栈并推入栈A(merge B A 即反) 题解:用一个C来辅助,每一次merge将AB中的数据依次压入C中(如何依次?用vector<pair<int,int> >,second 存入栈的id,先按id弹出到tmp,再压入c),然后清空.之后A B若pop到底则从C pop(题目保证C…