結果

問題 No.2299 Antitypoglycemia
ユーザー lllllll88938494
提出日時 2023-05-12 22:24:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 631 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-11-28 18:53:19
合計ジャッジ時間 2,366 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 1 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

a='yukicoder'
s=input()
ind=0
ans = []
g=-1
for i in range(len(s)):
    if i <= g:
        continue
    if s[i] == 'y':
        f = 0
        for j in range(1,len(a)):
            if i + j >= len(s):
                f = 1
                break
            if s[i+j] != a[j]:
                f = 1
                break
        if f == 0:
            ans.append(a)
            g=i+len(a)-1
        else:
            ans.append(0)
            
    else:
        ans.append(0)
    
A=0
cnt=0
for i in range(len(ans)):
    if ans[i] == a:
        cnt+=1
    else:
        A=max(A,cnt)
        cnt=0
        
print(max(A,cnt))
        
0