DANXIBAO_Hhh @ 2024-08-06 12:41:01
经过我的努力,60分了,求大佬调调,玄关
#include <bits/stdc++.h>
using namespace std;
const int N=1e6+10;
char s[N];
int i=0,a=0,b=0;
bool f1,f2;
int main() {
while(s[i]!='E'){
cin>>s[++i];
}
for(int j=1;s[j]!='E';j++){
if(s[j]=='W') a++;
else if(s[j]=='L') b++;
if(a==11&&abs(a-b)>=2){
cout<<a<<':'<<b<<endl;
a=0,b=0;
f1=1;
}
if(b==11&&abs(a-b)>=2){
cout<<a<<':'<<b<<endl;
a=0,b=0;
f1=1;
}
}
cout<<a<<':'<<b;
cout<<endl<<endl;
a=0,b=0;
for(int j=1;s[j]!='E';j++){
if(s[j]=='W') a++;
else if(s[j]=='L') b++;
if(a==21&&abs(a-b)>=2){
cout<<a<<':'<<b<<endl;
a=0,b=0;
f2=1;
}
if(b==21&&abs(a-b)>=2){
cout<<a<<':'<<b<<endl;
a=0,b=0;
f2=1;
}
}
cout<<a<<':'<<b;
return 0;
}
by sb2309 @ 2024-08-06 12:44:25
@DANXIBAO_Hhh 我也是过了好吧
by Hhh_Aaa @ 2024-08-06 12:47:31
O过了,不麻烦大佬了