結果

問題 No.2298 yukicounter
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-12 22:25:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 631 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 125,312 KB
最終ジャッジ日時 2024-05-06 12:28:59
合計ジャッジ時間 3,439 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,712 KB
testcase_01 AC 38 ms
51,712 KB
testcase_02 AC 38 ms
51,968 KB
testcase_03 AC 98 ms
107,904 KB
testcase_04 AC 69 ms
78,976 KB
testcase_05 AC 60 ms
65,280 KB
testcase_06 AC 129 ms
125,312 KB
testcase_07 AC 69 ms
77,696 KB
testcase_08 AC 59 ms
67,456 KB
testcase_09 AC 62 ms
71,040 KB
testcase_10 AC 54 ms
63,616 KB
testcase_11 AC 66 ms
73,600 KB
testcase_12 AC 65 ms
73,472 KB
testcase_13 AC 62 ms
71,680 KB
testcase_14 AC 63 ms
72,064 KB
testcase_15 AC 44 ms
59,904 KB
testcase_16 AC 55 ms
66,048 KB
testcase_17 AC 54 ms
64,896 KB
testcase_18 AC 37 ms
51,840 KB
testcase_19 AC 41 ms
51,712 KB
testcase_20 AC 38 ms
51,968 KB
testcase_21 AC 38 ms
51,712 KB
testcase_22 AC 57 ms
69,632 KB
testcase_23 AC 64 ms
72,320 KB
testcase_24 AC 89 ms
83,132 KB
testcase_25 AC 76 ms
77,492 KB
testcase_26 AC 64 ms
70,400 KB
testcase_27 AC 80 ms
80,440 KB
testcase_28 AC 55 ms
67,456 KB
testcase_29 AC 58 ms
67,456 KB
testcase_30 AC 46 ms
60,288 KB
testcase_31 AC 55 ms
66,304 KB
testcase_32 AC 62 ms
69,504 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