carbon_monoxide @ 2024-01-24 22:14:21
#include<bits/stdc++.h>
using namespace std;
char s[4];//就是这里!!!
int cnt,maxx,js;
int main(){
cin>>s;
for(int i=0;i<strlen(s);i++){
for(int j=i;j<strlen(s);j++){
if(s[j]=='G') cnt++;
else cnt--;
js++;
if(!cnt) maxx=max(maxx,js);
}
js=cnt=0;
}
cout<<maxx;
return 0;
}
好好好,怪不得帖子里大家都说
请求加强数据!!!
by carbon_monoxide @ 2024-01-24 22:18:31
@RSY @feecle6418
by metrixgo_caozhendi @ 2024-01-24 22:20:20
好家伙
by QWQAWAQWQAWA @ 2024-01-27 19:20:55
@metrixgo_caozhendi metrixgo! 话说这题确实容易 应该本来得用前缀和之类的
by FYZ111 @ 2024-04-29 19:56:43
......