???P1042 [NOIP2003 普及组] 乒乓球

P1042 [NOIP2003 普及组] 乒乓球

Wcx20120226 @ 2024-07-31 15:54:56

#include <bits/stdc++.h>
using namespace std;
string s;
int sum1,sum2;
int main()
{
    cin>>s;
    int i=0,lc=0;
    while(s[i+lc*11]!='E')
    {
        if(s[i+lc*11]=='W')
        {
            sum1++;
            i++;
        }
        if(s[i+lc*11]=='L')
        {
            sum2++;
            i++;
        }
        if(i==11)
        {
            cout<<sum1<<":"<<sum2<<endl;
            i=0;
            sum1=sum2=0;
            lc++;
        }
    }
    cout<<sum1<<":"<<sum2<<endl;
    i=sum1=sum2=lc=0;
    cout<<endl;
    while(s[i+lc*21]!='E')
    {
        if(s[i+lc*11]=='W')
        {
            sum1++;
            i++;
        }
        if(s[i+lc*11]=='L')
        {
            sum2++;
            i++;
        }
        if(i==21)
        {
            cout<<sum1<<":"<<sum2<<endl;
            i=1;
            sum1=sum2=0;
            lc++;
        }
    }
    cout<<sum1<<":"<<sum2<<endl;
    return 0;
}

3ms/564.00KB AC

1

Accepted, 得分 10.ok accepted 1.20s/560.00KB TLE

2

Time Limit Exceeded. 1.20s/680.00KB TLE

3

Time Limit Exceeded. 1.20s/568.00KB TLE

4

Time Limit Exceeded. 1.20s/612.00KB TLE

5

Time Limit Exceeded. 1.20s/560.00KB TLE

6

Time Limit Exceeded. 1.20s/556.00KB TLE

7

Time Limit Exceeded. 1.20s/564.00KB TLE

8

Time Limit Exceeded. 1.20s/680.00KB TLE

9

Time Limit Exceeded. 3ms/564.00KB AC

10

Accepted, 得分 10.ok accepted


by songyouyi @ 2024-08-04 20:05:36

@ Wcx20120226 这题是多组输入


|