結果

問題 No.2298 yukicounter
ユーザー ああいい
提出日時 2023-05-12 22:49:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 82,488 KB
実行使用メモリ 82,000 KB
最終ジャッジ日時 2024-11-28 19:24:57
合計ジャッジ時間 2,862 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()

U = "yukicoder"
l = []
i = 0
while i < len(S):
	if S[i] == "y":
		j = 0
		while i + j < len(S) and S[i + j] == U[j]:
			j += 1
			if j == len(U):
				l.append(i)
				break
		i += j
	else:
		i += 1
ans = 0
now = 0
if l:ans = 1
for i in range(1,len(l)):
	if l[i] - l[i-1] == len(U):
		if now == 0:
			now = 2
		else:
			now += 1
	else:
		if now > ans:
			ans = now
		now = 0
if now > ans:ans = now
print(ans)
0