結果

問題 No.418 ミンミンゼミ
ユーザー KSnitechKSnitech
提出日時 2017-10-17 15:34:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 1,000 ms
コード長 538 bytes
コンパイル時間 2,932 ms
コンパイル使用メモリ 72,248 KB
実行使用メモリ 56,536 KB
最終ジャッジ日時 2023-09-23 02:01:56
合計ジャッジ時間 7,033 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,416 KB
testcase_01 AC 114 ms
56,536 KB
testcase_02 AC 115 ms
55,656 KB
testcase_03 AC 114 ms
55,536 KB
testcase_04 AC 114 ms
56,044 KB
testcase_05 AC 115 ms
56,140 KB
testcase_06 AC 115 ms
55,692 KB
testcase_07 AC 114 ms
56,016 KB
testcase_08 AC 115 ms
56,048 KB
testcase_09 AC 114 ms
55,672 KB
testcase_10 AC 114 ms
55,800 KB
testcase_11 AC 114 ms
55,412 KB
testcase_12 AC 115 ms
55,736 KB
testcase_13 AC 117 ms
55,568 KB
testcase_14 AC 116 ms
55,852 KB
testcase_15 AC 114 ms
55,732 KB
testcase_16 AC 113 ms
55,692 KB
testcase_17 AC 112 ms
56,016 KB
testcase_18 AC 113 ms
56,148 KB
testcase_19 AC 113 ms
55,656 KB
testcase_20 AC 112 ms
55,796 KB
testcase_21 AC 112 ms
55,976 KB
testcase_22 AC 113 ms
55,820 KB
testcase_23 AC 113 ms
55,956 KB
testcase_24 AC 113 ms
55,824 KB
testcase_25 AC 113 ms
56,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Minmin {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        String S = stdIn.nextLine();
        int counter = 0;

        while (S.indexOf("mi") == 0) {
            S = S.substring(2);
            while (S.charAt(0) == '-') {
                S = S.substring(1);
            }
            if (S.charAt(0) == 'n') {
                S = S.substring(1);
                counter++;
            }
        }

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