結果

問題 No.418 ミンミンゼミ
コンテスト
ユーザー 大谷祐翔
提出日時 2025-11-07 15:40:58
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 49 ms / 1,000 ms
コード長 842 bytes
コンパイル時間 7,973 ms
コンパイル使用メモリ 169,860 KB
実行使用メモリ 185,932 KB
最終ジャッジ日時 2025-11-07 15:41:09
合計ジャッジ時間 10,128 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (111 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

class Program
{
    static void Main(string[] args)
    {
        string inputWord = Console.ReadLine()!;
        List<string> minList = new List<string>();
        string word = "";
        
        foreach (char c in inputWord)
        {
            word += c;
            if (c == 'n')
            {
                minList.Add(word);
                word = "";
            }
        }

        int count = 0;
        for (int i = 0; i < minList.Count; i++)
        {
            if (minList[i].Contains("mi"))
            {
                if (i + 1 != minList.Count && minList[i + 1] != "n")
                {
                    count++;
                }
                else if (i + 1 == minList.Count)
                {
                    count++;
                }
            }
        }

        Console.WriteLine(count);
    }
}
0