結果

問題 No.418 ミンミンゼミ
ユーザー deliciouscicadadeliciouscicada
提出日時 2016-09-22 09:04:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 578 bytes
コンパイル時間 2,981 ms
コンパイル使用メモリ 71,792 KB
実行使用メモリ 56,380 KB
最終ジャッジ日時 2023-09-23 01:00:24
合計ジャッジ時間 6,672 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,900 KB
testcase_01 AC 125 ms
55,700 KB
testcase_02 AC 122 ms
55,848 KB
testcase_03 AC 121 ms
56,000 KB
testcase_04 AC 119 ms
55,704 KB
testcase_05 AC 123 ms
56,256 KB
testcase_06 AC 124 ms
55,764 KB
testcase_07 AC 121 ms
55,788 KB
testcase_08 AC 122 ms
55,748 KB
testcase_09 AC 124 ms
55,964 KB
testcase_10 AC 121 ms
56,380 KB
testcase_11 AC 123 ms
56,040 KB
testcase_12 AC 124 ms
55,676 KB
testcase_13 AC 123 ms
55,724 KB
testcase_14 AC 123 ms
55,620 KB
testcase_15 AC 123 ms
55,808 KB
testcase_16 AC 121 ms
55,940 KB
testcase_17 AC 121 ms
56,188 KB
testcase_18 AC 124 ms
55,480 KB
testcase_19 AC 124 ms
55,780 KB
testcase_20 AC 124 ms
56,084 KB
testcase_21 AC 121 ms
55,496 KB
testcase_22 AC 122 ms
55,736 KB
testcase_23 AC 121 ms
55,748 KB
testcase_24 AC 121 ms
56,296 KB
testcase_25 AC 122 ms
55,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

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

		// 文字列の取得
		String line = sc.next();

		// 鳴き声の正規表現
		Pattern pattern = Pattern.compile("(mi-*?n)");
		Matcher matcher = pattern.matcher(line);

		// 文字列に含まれる鳴き声の数
		int matchCount = 0;

		while(matcher.find()) {
			matchCount++;
		}

		// 結果の表示
		System.out.println(matchCount);
	}
}
0