ericdan666 @ 2024-08-17 14:58:00
#include<bits/stdc++.h>
using namespace std;
const long long N=2600;
int main(void){
cin.tie(0);
cout.tie(0);
char c;
int n11[N],m11[N],n21[N],m21[N],i=1,j=1;
while(cin>>c){
if(c=='E') break;
if(n11[i]-m11[i]>=2&&max(n11[i],m11[i])>=11) i++;
if(n21[j]-m21[j]>=2&&max(n21[j],m21[j])>=21) j++;
if(c=='W') n11[i]++,n21[j]++;
if(c=='L') m11[i]++,m21[j]++;
}
for(int h=1;h<=i;h++) cout<<n11[h]<<":"<<m11[h]<<endl;
cout<<endl;
for(int h=1;h<=j;h++) cout<<n21[h]<<":"<<m21[h]<<endl;
return 0;
}
by Jason20090916 @ 2024-08-17 19:22:32
#include<bits/stdc++.h>
using namespace std;
const long long N=2600;
int main(void){
cin.tie(0);
cout.tie(0);
char c;
int n11[N],m11[N],n21[N],m21[N],i=1,j=1;
while(cin>>c){
if(c=='E') break;
if(abs(n11[i]-m11[i])>=2&&max(n11[i],m11[i])>=11) i++;
if(abs(n21[j]-m21[j])>=2&&max(n21[j],m21[j])>=21) j++;
if(c=='W') n11[i]++,n21[j]++;
if(c=='L') m11[i]++,m21[j]++;
}
for(int h=1;h<=i;h++) cout<<n11[h]<<":"<<m11[h]<<endl;
cout<<endl;
for(int h=1;h<=j;h++) cout<<n21[h]<<":"<<m21[h]<<endl;
return 0;
}
可能是绝对值的问题(双方分差大于两分都要结束)