結果
問題 |
No.418 ミンミンゼミ
|
ユーザー |
![]() |
提出日時 | 2025-03-20 18:40:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 37 ms / 1,000 ms |
コード長 | 412 bytes |
コンパイル時間 | 178 ms |
コンパイル使用メモリ | 82,416 KB |
実行使用メモリ | 53,728 KB |
最終ジャッジ日時 | 2025-03-20 18:40:12 |
合計ジャッジ時間 | 1,904 ms |
ジャッジサーバーID (参考情報) |
judge2 / 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)