結果

問題 No.2298 yukicounter
ユーザー moharan627
提出日時 2023-05-12 21:33:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 866 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 79,460 KB
最終ジャッジ日時 2024-11-28 17:29:50
合計ジャッジ時間 3,002 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(10 ** 6)
INF = float('inf')
#10**20,2**63に変えるのもあり
MOD = 10**9 + 7
MOD2 = 998244353
from collections import defaultdict
def ceil(A,B):
    return -(-A//B)
def solve():
    def II(): return int(sys.stdin.readline())
    def LI(): return list(map(int, sys.stdin.readline().split()))
    def LC(): return list(input())
    def IC(): return [int(c) for c in input()]
    def MI(): return map(int, sys.stdin.readline().split())
    S = input()
    N = len(S)
    yuki = "yukicoder"
    Y = [False]*N
    for i in range(N-8):
        if(S[i:i+9]==yuki):
            Y[i]=True
    Ans = 0
    #print(Y)
    for s in range(9):
        tmp=0
        for i in range(s,N-8,9):
            if(Y[i]):
                tmp+=1
            else:
                tmp=0
            Ans = max(Ans,tmp)
    print(Ans)

    return
solve()
0