Longest Regular Bracket Sequence 题面翻译 给出一个括号序列,求出最长合法子串和它的数量。 合法的定义:这个序列中左右括号匹配 题目描述 This is yet another problem dealing with regular bracket sequences. We should remind you that a bracket sequen
A. 高斯求和,如果2次幂小于n就减2次 #include<bits/stdc++.h>#define INF 1e9using namespace std;typedef long long ll;const int N=2e5+9;int a[N];int f[N],vis[N];ll sn(ll a1,ll an,ll num){return (a1+an)*num/2;}