結果

問題 No.418 ミンミンゼミ
ユーザー cande398cande398
提出日時 2017-10-08 15:52:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 115 ms / 1,000 ms
コード長 384 bytes
コンパイル時間 2,656 ms
コンパイル使用メモリ 71,236 KB
実行使用メモリ 56,288 KB
最終ジャッジ日時 2023-09-23 02:00:26
合計ジャッジ時間 6,479 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,948 KB
testcase_01 AC 112 ms
56,036 KB
testcase_02 AC 114 ms
56,128 KB
testcase_03 AC 111 ms
55,980 KB
testcase_04 AC 113 ms
56,272 KB
testcase_05 AC 114 ms
55,928 KB
testcase_06 AC 113 ms
56,288 KB
testcase_07 AC 112 ms
55,444 KB
testcase_08 AC 114 ms
56,016 KB
testcase_09 AC 112 ms
55,872 KB
testcase_10 AC 112 ms
55,808 KB
testcase_11 AC 115 ms
54,220 KB
testcase_12 AC 115 ms
55,748 KB
testcase_13 AC 113 ms
56,036 KB
testcase_14 AC 114 ms
55,464 KB
testcase_15 AC 113 ms
56,284 KB
testcase_16 AC 113 ms
55,896 KB
testcase_17 AC 114 ms
56,056 KB
testcase_18 AC 114 ms
56,044 KB
testcase_19 AC 113 ms
55,556 KB
testcase_20 AC 112 ms
55,300 KB
testcase_21 AC 112 ms
55,608 KB
testcase_22 AC 113 ms
55,812 KB
testcase_23 AC 114 ms
56,204 KB
testcase_24 AC 112 ms
55,620 KB
testcase_25 AC 111 ms
55,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
  public static void main(String[] args){
    int i, count = 0;
    Scanner sc = new Scanner(System.in);
    String input = sc.next();
    if(input.charAt(input.length()-1) != 'n')count--;
    String[] line = input.split("n");
    for(i=0;i<line.length;i++){
      if(line[i].matches("mi-*"))count++;
    }
    System.out.println(count);
  }
}
0