#45792: python


wming0264@gmail.com (User)

學校 : 不指定學校
編號 : 304439
來源 : [49.216.234.131]
最後登入時間 :
2025-04-09 13:53:47
c657. 最長連續字母 -- it's david | From: [180.177.14.82] | 發表日期 : 2025-04-13 11:56

try:
    while True:
        a = input()
        count = 0     
        temp = a[0]
        max_count = 1    
        for x in a:
            if temp == x:
                count += 1
                if max_count < count:
                    max_count = count
                    max_alph = temp
                else:
                    pass              
            else:
                if max_count < count:
                    max_count = count
                    max_alph = temp
                else:
                    pass                           
                count = 1
                temp = x
        print(max_alph, max_count)
except EOFError:
    pass

 
ZeroJudge Forum