結果

問題 No.418 ミンミンゼミ
ユーザー yamax3232yamax3232
提出日時 2017-02-17 11:28:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 1,000 ms
コード長 575 bytes
コンパイル時間 4,737 ms
コンパイル使用メモリ 71,872 KB
実行使用メモリ 56,372 KB
最終ジャッジ日時 2023-09-23 01:48:34
合計ジャッジ時間 7,123 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
56,016 KB
testcase_01 AC 115 ms
55,780 KB
testcase_02 AC 115 ms
55,888 KB
testcase_03 AC 114 ms
55,824 KB
testcase_04 AC 113 ms
56,132 KB
testcase_05 AC 111 ms
55,712 KB
testcase_06 AC 112 ms
56,036 KB
testcase_07 AC 113 ms
55,872 KB
testcase_08 AC 113 ms
56,028 KB
testcase_09 AC 114 ms
56,372 KB
testcase_10 AC 114 ms
55,968 KB
testcase_11 AC 115 ms
55,752 KB
testcase_12 AC 110 ms
55,960 KB
testcase_13 AC 113 ms
55,756 KB
testcase_14 AC 112 ms
56,164 KB
testcase_15 AC 112 ms
56,048 KB
testcase_16 AC 116 ms
56,332 KB
testcase_17 AC 111 ms
55,964 KB
testcase_18 AC 114 ms
56,104 KB
testcase_19 AC 114 ms
56,220 KB
testcase_20 AC 114 ms
55,616 KB
testcase_21 AC 110 ms
55,656 KB
testcase_22 AC 111 ms
56,016 KB
testcase_23 AC 109 ms
55,980 KB
testcase_24 AC 111 ms
55,836 KB
testcase_25 AC 113 ms
55,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
//セミがなくクラスを冬に作るってどうなの...((
//未完未完未完
public class Semi {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner kb=new Scanner(System.in);
		String a=kb.next();
		char min[]=a.toCharArray();
		int count=0;
		for(int i=0;i<a.length();i++){
			int t=i+1;
			int u=i;
			if(t>=a.length()){
				break;
			}
			else if(min[i]=='m'&&min[t]=='i'){
				while(min[u]!='n'){
					u++;
				}
				count++;
			}
		}
		System.out.printf("%d\n", count);
	}
}

0