結果

問題 No.2298 yukicounter
ユーザー ああいいああいい
提出日時 2023-05-12 22:49:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 81,552 KB
最終ジャッジ日時 2024-05-06 12:51:53
合計ジャッジ時間 3,003 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
51,584 KB
testcase_01 AC 35 ms
51,456 KB
testcase_02 AC 35 ms
51,840 KB
testcase_03 AC 60 ms
71,552 KB
testcase_04 AC 60 ms
65,408 KB
testcase_05 AC 53 ms
62,464 KB
testcase_06 AC 64 ms
75,776 KB
testcase_07 AC 50 ms
64,256 KB
testcase_08 AC 48 ms
62,336 KB
testcase_09 AC 50 ms
63,872 KB
testcase_10 AC 44 ms
59,648 KB
testcase_11 AC 49 ms
63,104 KB
testcase_12 AC 51 ms
63,104 KB
testcase_13 AC 54 ms
68,224 KB
testcase_14 AC 58 ms
68,864 KB
testcase_15 AC 42 ms
58,240 KB
testcase_16 AC 53 ms
65,024 KB
testcase_17 AC 50 ms
63,104 KB
testcase_18 AC 36 ms
51,968 KB
testcase_19 AC 36 ms
51,712 KB
testcase_20 AC 36 ms
51,456 KB
testcase_21 AC 38 ms
52,352 KB
testcase_22 AC 52 ms
67,712 KB
testcase_23 AC 56 ms
68,480 KB
testcase_24 AC 79 ms
81,552 KB
testcase_25 AC 69 ms
78,208 KB
testcase_26 AC 53 ms
66,432 KB
testcase_27 AC 72 ms
79,552 KB
testcase_28 AC 51 ms
66,176 KB
testcase_29 AC 50 ms
65,152 KB
testcase_30 AC 43 ms
59,520 KB
testcase_31 AC 47 ms
62,848 KB
testcase_32 AC 53 ms
66,176 KB
権限があれば一括ダウンロードができます

ソースコード

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