結果
問題 |
No.418 ミンミンゼミ
|
ユーザー |
![]() |
提出日時 | 2025-03-20 20:17:59 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 39 ms / 1,000 ms |
コード長 | 412 bytes |
コンパイル時間 | 164 ms |
コンパイル使用メモリ | 82,344 KB |
実行使用メモリ | 54,196 KB |
最終ジャッジ日時 | 2025-03-20 20:18:33 |
合計ジャッジ時間 | 1,959 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
S = input().strip() count = 0 i = 0 n = len(S) while i < n: if i + 1 < n and S[i] == 'm' and S[i+1] == 'i': j = i + 2 while j < n and S[j] == '-': j += 1 if j < n and S[j] == 'n': count += 1 i = j + 1 else: # According to the problem statement, this case will not occur i += 1 else: i += 1 print(count)