結果
| 問題 | No.418 ミンミンゼミ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-02 19:55:06 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 1,000 ms |
| + 666µs | |
| コード長 | 838 bytes |
| 記録 | |
| コンパイル時間 | 1,914 ms |
| コンパイル使用メモリ | 84,016 KB |
| 実行使用メモリ | 40,832 KB |
| 最終ジャッジ日時 | 2026-07-19 23:51:11 |
| 合計ジャッジ時間 | 4,564 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
import java.io.*;
import java.util.regex.*;
// 処理
class Process {
private String S;
Process(String S) {
this.S = S;
}
int getResult() {
Matcher matcher = Pattern.compile("mi-*n").matcher(S);
int count = 0;
while(matcher.find()) {
count++;
}
return count;
}
}
public class Main {
public static void main(String[] args) throws IOException {
var bufferedReader = new BufferedReader(new InputStreamReader(System.in));
var printWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
// 入力
String S = bufferedReader.readLine().trim();
// 出力
printWriter.println((new Process(S)).getResult());
bufferedReader.close();
printWriter.close();
}
}