結果

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

ソースコード

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
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