結果

問題 No.418 ミンミンゼミ
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-01-18 23:28:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 546 bytes
コンパイル時間 2,929 ms
コンパイル使用メモリ 73,140 KB
実行使用メモリ 56,228 KB
最終ジャッジ日時 2023-09-23 01:46:17
合計ジャッジ時間 7,031 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,728 KB
testcase_01 AC 122 ms
55,800 KB
testcase_02 AC 121 ms
55,960 KB
testcase_03 AC 121 ms
55,684 KB
testcase_04 AC 121 ms
55,928 KB
testcase_05 AC 119 ms
55,808 KB
testcase_06 AC 122 ms
56,092 KB
testcase_07 AC 123 ms
55,996 KB
testcase_08 AC 119 ms
56,108 KB
testcase_09 AC 120 ms
55,456 KB
testcase_10 AC 119 ms
56,052 KB
testcase_11 AC 119 ms
56,224 KB
testcase_12 AC 122 ms
56,176 KB
testcase_13 AC 120 ms
55,780 KB
testcase_14 AC 121 ms
55,704 KB
testcase_15 AC 123 ms
55,804 KB
testcase_16 AC 120 ms
55,856 KB
testcase_17 AC 126 ms
56,228 KB
testcase_18 AC 122 ms
56,052 KB
testcase_19 AC 121 ms
55,616 KB
testcase_20 AC 119 ms
55,372 KB
testcase_21 AC 119 ms
55,724 KB
testcase_22 AC 119 ms
55,780 KB
testcase_23 AC 119 ms
55,824 KB
testcase_24 AC 121 ms
55,888 KB
testcase_25 AC 121 ms
55,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

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

        int min_count = 0;

        s = s.replaceAll("-", "");
        s = s.replaceAll("min", "a");

        for(int i=0; i<s.length(); i++) {
            if(s.charAt(i) == 'a') {
                min_count++;
            }
        }

        System.out.println(min_count);

        in.close();
    }
}
0