这题有毒吧,对拍一模一样全WA
查看原帖
这题有毒吧,对拍一模一样全WA
1170071
Operation0701楼主2023/12/4 22:57
S = ''
while True:
    s = input()
    if 'E' in s:
        S += s.split('E')[0]
        break
    S += s
#输入处理部分
def match(x,s):
    cnt = 0
    while True:
        scorea = 0
        scoreb = 0
        d = 0
        while (max(scorea,scoreb) < x or d < 2) and cnt < len(s):
            if s[cnt] == 'W':
                scorea += 1
            else:
                scoreb += 1
            cnt += 1
            d = abs(scorea - scoreb)
        print(f'{scorea}:{scoreb}')
        if cnt == len(s):
            break
#主判断函数                       
match(11,S)
print('')
match(21,S)
#输出部分

能不能解释一下

为什么

文本比对一模一样的输出,结果全部WA

2023/12/4 22:57
加载中...