結果

問題 No.418 ミンミンゼミ
ユーザー funakoshi
提出日時 2019-08-20 14:24:40
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 584 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 29,440 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 12:11:57
合計ジャッジ時間 1,160 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
int main(void)
{
    char str[150]="";
    int mcnt=0,icnt=0,ncnt=0,min=0;
    scanf("%s",str);
    for(int i=0;i<strlen(str);i++)
    {
        if(str[i]=='m')
        {
            mcnt++;
        }
        else if (str[i]=='i')
        {
            icnt++;
        }
        else if (str[i]=='n')
        {
            ncnt++;
        }
        if(mcnt>0&&icnt>0&&ncnt>0)
        {
            min++;
            mcnt--;
            icnt--;
            ncnt--;
        }
    }
    printf("%d",min);
}
0