結果
| 問題 |
No.2298 yukicounter
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 18:46:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 2,000 ms |
| コード長 | 610 bytes |
| コンパイル時間 | 277 ms |
| コンパイル使用メモリ | 82,424 KB |
| 実行使用メモリ | 73,136 KB |
| 最終ジャッジ日時 | 2025-03-20 18:46:56 |
| 合計ジャッジ時間 | 3,003 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
S = input().strip()
pattern = 'yukicoder'
pattern_length = len(pattern)
starts = []
start = 0
while True:
pos = S.find(pattern, start)
if pos == -1:
break
starts.append(pos)
start = pos + pattern_length # Move past the current occurrence
if not starts:
print(0)
else:
max_k = 1
current_k = 1
for i in range(1, len(starts)):
if starts[i] == starts[i-1] + pattern_length:
current_k += 1
if current_k > max_k:
max_k = current_k
else:
current_k = 1 # Reset for a new potential sequence
print(max_k)
lam6er