結果

問題 No.2298 yukicounter
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-12 22:25:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 631 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 112,796 KB
最終ジャッジ日時 2023-08-19 05:16:34
合計ジャッジ時間 4,695 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,256 KB
testcase_01 AC 61 ms
71,208 KB
testcase_02 AC 61 ms
71,364 KB
testcase_03 AC 113 ms
112,796 KB
testcase_04 AC 88 ms
88,024 KB
testcase_05 AC 73 ms
77,536 KB
testcase_06 AC 128 ms
111,812 KB
testcase_07 AC 88 ms
87,648 KB
testcase_08 AC 77 ms
79,272 KB
testcase_09 AC 79 ms
82,360 KB
testcase_10 AC 73 ms
76,612 KB
testcase_11 AC 81 ms
84,468 KB
testcase_12 AC 84 ms
84,432 KB
testcase_13 AC 81 ms
79,228 KB
testcase_14 AC 82 ms
79,988 KB
testcase_15 AC 70 ms
76,428 KB
testcase_16 AC 78 ms
76,864 KB
testcase_17 AC 74 ms
76,596 KB
testcase_18 AC 63 ms
71,512 KB
testcase_19 AC 62 ms
71,208 KB
testcase_20 AC 59 ms
70,988 KB
testcase_21 AC 61 ms
71,140 KB
testcase_22 AC 74 ms
77,384 KB
testcase_23 AC 83 ms
77,328 KB
testcase_24 AC 99 ms
83,524 KB
testcase_25 AC 85 ms
79,416 KB
testcase_26 AC 80 ms
76,708 KB
testcase_27 AC 93 ms
82,136 KB
testcase_28 AC 75 ms
76,408 KB
testcase_29 AC 76 ms
76,268 KB
testcase_30 AC 69 ms
76,568 KB
testcase_31 AC 76 ms
76,632 KB
testcase_32 AC 78 ms
76,608 KB
権限があれば一括ダウンロードができます

ソースコード

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