70分求助
查看原帖
70分求助
307731
白手楼主2020/5/20 21:38
#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
const int Max=2e5+20;
struct f1
{
public:
    int l,r;
}F1[3000];
struct f2
{
public:
    int l,r;
}F2[3000];
int main()
{
    std::ios::sync_with_stdio(false);
    char a;
    int nood1=0,nood2=0;
    while(cin>>a)
    {
        if(a=='W') {F1[nood1].l++;F2[nood2].l++;}
        if(a=='L') {F1[nood1].r++;F2[nood2].r++;}
        if(max(F1[nood1].l,F1[nood1].r)>=11&&abs(F1[nood1].l-F1[nood1].r)>=2) nood1++;
        if(max(F2[nood2].l,F2[nood2].r)>=21&&abs(F2[nood2].l-F2[nood2].r)>=2) nood2++;
        if(a=='E') break;

    }
     for(int i=0;i<=nood1;i++)
     {
         if(i==nood1&&F1[i].l==0&&F1[i].r==0) break;
         cout<<F1[i].l<<":"<<F1[i].r<<endl;
     }
     cout<<endl;
     for(int i=0;i<=nood2;i++)
     {
         if(i==nood2&&F2[i].l==0&&F2[i].r==0) break;
         cout<<F2[i].l<<":"<<F2[i].r<<endl;
     }
}

两个WA,一个RE

2020/5/20 21:38
加载中...