题目链接
http://noi-test.zzstep.com/contest/0x18%E3%80%8C%E5%9F%BA%E6%9C%AC%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E3%80%8D%E7%BB%83%E4%B9%A0/1801%20%E6%8B%AC%E5%8F%B7%E7%94%BB%E5%AE%B6
分析
读入左括号则入栈,读入右括号则检查栈顶是否与之匹配,匹配则长度 + 2 + 2 +2;不匹配则弹空栈,重新记录长度。
AC代码
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <stack>
using namespace std;
const int maxn = 1e5 + 5;
char s[maxn