結果
| 問題 | No.2298 yukicounter |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-12 22:49:37 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 419 bytes |
| 記録 | |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 85,720 KB |
| 最終ジャッジ日時 | 2026-05-22 18:10:14 |
| 合計ジャッジ時間 | 2,748 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
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)