08 2020 档案
摘要:分析: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long LL; const int N = 100010; int row[N], col[N], s[N
阅读全文
摘要:求一个括号序列的合法子串个数 dp[i]表示以i结尾的合法的括号序列个数 维护一个栈,左括号push他的位置到栈中,右括号取出栈顶 dp[i] = dp[sta[top] - 1] + 1 然后对dp数组求和 int sta[MAXN * 10], top, ans[MAXN * 10]; ll A
阅读全文