求救~qwq,改了半天还是只有30......

P1042 [NOIP2003 普及组] 乒乓球

peach3 @ 2024-08-17 15:45:40

#include<bits/stdc++.h>
using namespace std;
int main(){
    char a;
    int n=0,m=0,b=0,c=0,d[2501],e[2501],v[2501];
    for(int i=1;i<=62525;i++){
        cin>>a;
        v[i]=a;
        if(a=='W'){
            n++;
            if(n%11==0){
                for(int j=1;j<=n/11;j++){
                    b++;
                    d[b]=m;
                    n=0;
                }
            }
        }
        if(a=='L'){
            m++;
            if(m%11==0){
                for(int k=1;k<=m/11;k++){
                    c++;
                    e[c]=m;
                    m=0;
                }
            }
        }
        if(a=='E'){
            for(int l=1;l<=b;l++){
                cout<<"11"<<":"<<d[l]<<endl;
            }
            for(int o=1;o<=c;o++){
                cout<<"11"<<":"<<e[o]<<endl;
            }
            cout<<n<<":"<<m<<endl;
            int p=0,q=0,t=0,y=0,u[2501],z[2501];    
            cout<<" "<<endl;
            for(int i=1;i<=62525;i++){
                if(v[i]=='W'){
                    p++;
                    if(p%21==0){
                        for(int j=1;j<=p/21;j++){
                            t++;
                            u[t]=q;
                            p=0;
                        }
                    }
                }
                if(v[i]=='L'){
                    q++;
                    if(q%21==0){
                        for(int k=1;k<=q/21;k++){
                            y++;
                            z[y]=q;
                            q=0;
                        }
                    }
                }
                if(v[i]=='E'){
                    for(int l=1;l<=t;l++){
                        cout<<"21"<<":"<<u[l]<<endl;
                    }
                for(int o=1;o<=y;o++){
                    cout<<"21"<<":"<<z[o]<<endl;
                }
                cout<<p<<":"<<q<<endl;
                return 0;
            }   
        }
        }   
    }   
}

by ericdan666 @ 2024-08-17 15:56:15

用while输入吧


by ericdan666 @ 2024-08-17 15:57:14

并且不一定全是21,有可能25:23


by peach3 @ 2024-08-17 16:41:29

@ericdan666 如果有25:23可以分两次记吗?


by peach3 @ 2024-08-17 16:46:42

@ericdan666 哦,懂了,20:20好像是要加赛所以不一定是21.


by ericdan666 @ 2024-08-17 17:24:49

互相关注好吗


by Tsr0409 @ 2024-08-19 17:04:26

比赛规则会使的得分可能超过11或者21


by peach3 @ 2024-08-20 16:21:45

@ericdan666 关注了


|