結果
| 問題 |
No.418 ミンミンゼミ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-17 12:04:57 |
| 言語 | OCaml (5.2.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 401 bytes |
| コンパイル時間 | 358 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 01:22:22 |
| 合計ジャッジ時間 | 1,129 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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")