結果
| 問題 | No.418 ミンミンゼミ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-17 12:04:57 |
| 言語 | OCaml (5.4.1) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 401 bytes |
| 記録 | |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 22,156 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-25 05:05:27 |
| 合計ジャッジ時間 | 1,283 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
let () =
let rec search s c =
match s with
| [] -> 0
| f :: r ->
if f = "m" then search r "i"
else if f = "i" then if c = "i" then search r "n" else search r "m"
else if c = "n" then if f = "-" then search r "n" else 1 + search r "m"
else search r "m" in
let s = read_line () in
let lst = Str.split (Str.regexp "") s in
Printf.printf "%d\n" (search lst "m")