結果

問題 No.418 ミンミンゼミ
ユーザー yagi2yagi2
提出日時 2017-04-16 23:55:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 1,000 ms
コード長 523 bytes
コンパイル時間 2,492 ms
コンパイル使用メモリ 73,120 KB
実行使用メモリ 56,432 KB
最終ジャッジ日時 2023-09-23 01:50:16
合計ジャッジ時間 6,665 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,432 KB
testcase_01 AC 117 ms
55,716 KB
testcase_02 AC 113 ms
55,992 KB
testcase_03 AC 116 ms
56,384 KB
testcase_04 AC 115 ms
56,020 KB
testcase_05 AC 115 ms
55,784 KB
testcase_06 AC 116 ms
56,140 KB
testcase_07 AC 115 ms
55,772 KB
testcase_08 AC 117 ms
56,220 KB
testcase_09 AC 116 ms
55,420 KB
testcase_10 AC 116 ms
55,672 KB
testcase_11 AC 113 ms
55,564 KB
testcase_12 AC 114 ms
55,984 KB
testcase_13 AC 115 ms
55,892 KB
testcase_14 AC 115 ms
55,892 KB
testcase_15 AC 115 ms
55,632 KB
testcase_16 AC 115 ms
56,016 KB
testcase_17 AC 114 ms
55,640 KB
testcase_18 AC 115 ms
55,556 KB
testcase_19 AC 115 ms
55,540 KB
testcase_20 AC 116 ms
55,532 KB
testcase_21 AC 115 ms
55,872 KB
testcase_22 AC 122 ms
56,004 KB
testcase_23 AC 116 ms
55,620 KB
testcase_24 AC 116 ms
56,204 KB
testcase_25 AC 118 ms
56,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next() + "A";

        int cnt = 0;
        boolean minFlag = false;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == 'm' && S.charAt(i+1) == 'i') minFlag = true;
            if (minFlag && S.charAt(i) == 'n') {
                cnt++;
                minFlag = false;
            }
        }

        System.out.println(cnt);
    }
}
0