想法是递推往前走,记录当前子序列的CG个数,往后滑动的时候减去头加上尾 #include <iostream> #include <string> using namespace std; int main() { string s; int N; cin >> s >> N; &...