結果

問題 No.418 ミンミンゼミ
ユーザー tsunabittsunabit
提出日時 2018-06-27 10:36:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 1,000 ms
コード長 500 bytes
コンパイル時間 3,570 ms
コンパイル使用メモリ 73,184 KB
実行使用メモリ 56,716 KB
最終ジャッジ日時 2023-09-23 02:11:49
合計ジャッジ時間 7,992 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
56,012 KB
testcase_01 AC 113 ms
55,636 KB
testcase_02 AC 116 ms
56,144 KB
testcase_03 AC 113 ms
56,216 KB
testcase_04 AC 115 ms
55,716 KB
testcase_05 AC 114 ms
56,064 KB
testcase_06 AC 115 ms
55,528 KB
testcase_07 AC 114 ms
55,876 KB
testcase_08 AC 116 ms
56,124 KB
testcase_09 AC 116 ms
56,716 KB
testcase_10 AC 115 ms
56,112 KB
testcase_11 AC 116 ms
53,832 KB
testcase_12 AC 117 ms
56,180 KB
testcase_13 AC 117 ms
55,772 KB
testcase_14 AC 115 ms
55,884 KB
testcase_15 AC 116 ms
55,920 KB
testcase_16 AC 117 ms
56,116 KB
testcase_17 AC 116 ms
55,720 KB
testcase_18 AC 115 ms
55,732 KB
testcase_19 AC 114 ms
55,892 KB
testcase_20 AC 115 ms
55,704 KB
testcase_21 AC 115 ms
55,384 KB
testcase_22 AC 116 ms
56,232 KB
testcase_23 AC 114 ms
55,848 KB
testcase_24 AC 115 ms
55,952 KB
testcase_25 AC 122 ms
55,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.Stream;

public class No418 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		String s = sc.next().replace("-", "");
		int count = 0;
		for(int i = 0; i < s.length(); i = i + 3) {
			if(s.charAt(i) == 'm' && s.charAt(i + 1) == 'i' && s.charAt(i + 2) == 'n') {
					if(i + 3 == s.length()) {
							count++;
					}else if(s.charAt(i + 3) != 'n') {
							count++;
					}
			}
		}
		System.out.println(count);
	}
}
0