結果

問題 No.2298 yukicounter
ユーザー n_na
提出日時 2023-05-13 01:22:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 80,972 KB
最終ジャッジ日時 2024-11-28 21:48:08
合計ジャッジ時間 2,684 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
N = len(S)
T = "yukicoder"
M = len(T)

res = []
for i in range(N-M+1):
    fg = True
    for j in range(M):
        if S[i+j] != T[j]:
            fg = False
            break
    if fg:
        res.append(i//9 + i%9)
ans = 0
c = 1
for i in range(len(res) - 1):
    if res[i+1] == res[i] + 1:
        c += 1
        ans = max(c, ans)
    else:
        c = 1
        
print(ans)
    
0