![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
栈
wwt9b15bs
这个作者很懒,什么都没留下…
展开
-
【题解】hdu4699 对顶栈
题目链接 对于I x 操作: 1.把x插入栈A; 2.更新sum[pa]=sum[pa-1]+a[pa]; 3.更新f[pa]=max(f[pa-1],sum[pa])。 对于D操作,把A的栈顶出栈。 对于L操作,弹出A的栈顶,插入到B中。 对于R操作: 1.弹出B的栈顶,插入到A中。 2.更新sum[pa]=sum[pa-1]+a[pa]; 3.更新f[pa]=max(f[p...原创 2018-08-27 15:53:45 · 216 阅读 · 0 评论 -
【题解】CH1101 栈+vector
#include<cstdio> #include<stack> #include<vector> using namespace std; int n,cnt; vector<int>vx; void dfs(stack<int&a原创 2018-08-27 15:54:17 · 239 阅读 · 0 评论 -
【题解】洛谷P1739表达式括号匹配 栈
题目链接 #include<cstdio> #include<cstring> char s[30000]; int main(){ //freopen("in.txt","r",stdin); scanf("%s",s+1); int i,p=0,len=strlen(s+1);原创 2018-09-06 07:45:13 · 243 阅读 · 0 评论 -
【题解】洛谷P1449后缀表达式 栈
题目链接 #include<cstdio> #include<cstring> #include<stack> using namespace std; typedef long long ll; char a[10010]; int main(){ //freopen("in.txt","r",原创 2018-09-06 07:45:23 · 237 阅读 · 0 评论