全为左右括号的字符串,定义其对应的值为最长有效括号子序列的字符数,如())())最长有效括号子序列()(),因此对应的值为4 求字符串所有子串对应的值的和 例子1:())()) 输出1:26 #include <iostream> #include <string> #include <vector> using namespace std; int main(){ string str; cin >> str; vector<int> count_vec; // 如())())的count_...