結果

問題 No.418 ミンミンゼミ
ユーザー Theta
提出日時 2022-10-24 17:47:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 1,000 ms
コード長 383 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2024-07-02 20:53:00
合計ジャッジ時間 2,299 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    S = input()
    ctr = 0
    current_idx = 0
    while current_idx < len(S):
        current_idx = S.find("mi", current_idx)
        if current_idx == -1:
            break
        current_idx = S.find("n", current_idx+2)
        if current_idx == -1:
            break

        ctr += 1
        current_idx += 1
    print(ctr)


if __name__ == "__main__":
    main()
0