結果

問題 No.2298 yukicounter
ユーザー Michirakara
提出日時 2023-05-12 23:57:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 664 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 68,012 KB
最終ジャッジ日時 2024-11-28 20:50:08
合計ジャッジ時間 4,067 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input().replace("yukicoder","A")
def RLE(l:str):
  if len(l)==0:
    return []
  out=[[l[0],1]]
  for i in range(1,len(l)):
    if l[i]!=l[i-1]:
      out.append([l[i],1])
    else:
      out[-1][1]+=1
  return out
l=RLE(s)
ma=0
for i in l:
	if i[0]=="A":ma=max(ma,i[1])
print(ma)
0