80%怎么回事?(NOIP2003复赛普及组T1)

#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

char a[200001];

int len = 0;
char c;
int win;
int lose;

int main()
{
    while (1) {
        c = getchar();
        if (c == 'E') {
            break;
        }
        len++;
        a[len] = c;
    }
    int i = 1;
    win = 0, lose = 0;
    while (i <= len) {
        if (a[i] == 'W') win++;
        if (a[i] == 'L') lose++;
        if ((win >= 11 or lose >= 11)and(abs(win-lose) >= 2)) {
            printf("%d:%d\n", win, lose);
            win = lose = 0;
        }
        i++;
    }
    if ((win > 0 or lose > 0)and(not((win >= 11 or lose >= 11)and(abs(win-lose) >= 2)))) {
        printf("%d:%d\n", win, lose);
        win = lose = 0;
    }
    cout << endl;
    i = 1;
    while (i <= len) {
        if (a[i] == 'W') win++;
        if (a[i] == 'L') lose++;
        if ((win >= 21 or lose >= 21)and(abs(win-lose) >= 2)) {
            printf("%d:%d\n", win, lose);
            win = lose = 0;
        }
        i++;
    }
    if ((win > 0 or lose > 0)and(not((win >= 21 or lose >= 21)and(abs(win-lose) >= 2)))) {
        printf("%d:%d\n", win, lose);
        win = lose = 0;
    }
    return 0;
}
全部评论

相关推荐

11-23 15:33
已编辑
门头沟学院 Java
CUTMR:换账号试试重启推荐算法,我换账号之后回复率还不错,约莫有个20%左右的消息回复率,前几页、主动招呼的HR也开始符合我期望薪资,此前的大号从招呼、回复、前几页的岗位薪资在涨幅30%+以上 用着用着聊着聊着就变成-20%,而且我开通会员之后直接0面试
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务