結果

問題 No.418 ミンミンゼミ
ユーザー darknightdarknight
提出日時 2016-11-27 16:30:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 114 ms / 1,000 ms
コード長 558 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 72,928 KB
実行使用メモリ 57,892 KB
最終ジャッジ日時 2023-09-23 01:42:57
合計ジャッジ時間 5,954 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
55,820 KB
testcase_01 AC 110 ms
56,032 KB
testcase_02 AC 108 ms
55,920 KB
testcase_03 AC 110 ms
55,732 KB
testcase_04 AC 108 ms
55,904 KB
testcase_05 AC 107 ms
57,892 KB
testcase_06 AC 109 ms
55,788 KB
testcase_07 AC 110 ms
55,628 KB
testcase_08 AC 108 ms
53,944 KB
testcase_09 AC 111 ms
56,112 KB
testcase_10 AC 114 ms
55,984 KB
testcase_11 AC 111 ms
56,104 KB
testcase_12 AC 112 ms
55,732 KB
testcase_13 AC 113 ms
56,108 KB
testcase_14 AC 112 ms
55,800 KB
testcase_15 AC 113 ms
55,924 KB
testcase_16 AC 112 ms
55,504 KB
testcase_17 AC 111 ms
55,784 KB
testcase_18 AC 107 ms
55,724 KB
testcase_19 AC 110 ms
55,736 KB
testcase_20 AC 111 ms
56,248 KB
testcase_21 AC 111 ms
55,860 KB
testcase_22 AC 112 ms
55,952 KB
testcase_23 AC 114 ms
55,872 KB
testcase_24 AC 112 ms
55,836 KB
testcase_25 AC 112 ms
56,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
 
public class Main {
	public static void main(String[] args) {
 
	Scanner sc  = new Scanner(System.in);
        
    String s1 = sc.next();
    char[] c1 = s1.toCharArray();
    int f=0;
    int ans=0;
    
    for( int i=0; i<s1.length(); i++ ){
        
        if(c1[i]=='m'&&f==0)
        {
            f++;
        }else if(c1[i]=='i'&&f==1){
            f++;
        }else if(c1[i]=='n'&&f==2){
            f=0;
            ans++;
        }
        
    }

        System.out.print(ans);
        System.out.println();
	}
        
}
0