結果
問題 | No.2298 yukicounter |
ユーザー |
![]() |
提出日時 | 2024-07-17 09:22:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 257 ms / 2,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 113 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 58,656 KB |
最終ジャッジ日時 | 2024-07-17 09:22:53 |
合計ジャッジ時間 | 3,884 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
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 S=input() S=S.replace("yukicoder","#") ans=0 for s,c in Run_Length(S): if s=="#": ans=max(ans,c) print(ans)