結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー vwxyz
提出日時 2022-08-05 17:23:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 1,000 ms
コード長 490 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-15 12:54:59
合計ジャッジ時間 2,148 ms
ジャッジサーバーID
(参考情報)
judge6 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

def Run_Length(lst):
    run_length=[]
    if lst:
        prev=lst[0]
        cnt=1
        for x in lst[1:]:
            if x==prev:
                cnt+=1
            else:
                run_length.append((prev,cnt))
                prev=x
                cnt=1
        run_length.append((prev,cnt))
    return run_length

C=readline().rstrip()+readline().rstrip()
ans=0
for s,c in Run_Length(C):
    if s=="o":
        ans=max(ans,c)
print(ans)
0