結果
問題 | No.418 ミンミンゼミ |
ユーザー |
![]() |
提出日時 | 2016-11-27 16:30:42 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 124 ms / 1,000 ms |
コード長 | 558 bytes |
コンパイル時間 | 2,233 ms |
コンパイル使用メモリ | 74,632 KB |
実行使用メモリ | 41,536 KB |
最終ジャッジ日時 | 2024-07-16 02:14:58 |
合計ジャッジ時間 | 6,705 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s1 = sc.next(); char[] c1 = s1.toCharArray(); int f=0; int ans=0; for( int i=0; i<s1.length(); i++ ){ if(c1[i]=='m'&&f==0) { f++; }else if(c1[i]=='i'&&f==1){ f++; }else if(c1[i]=='n'&&f==2){ f=0; ans++; } } System.out.print(ans); System.out.println(); } }