結果
問題 |
No.418 ミンミンゼミ
|
ユーザー |
|
提出日時 | 2025-10-03 08:47:55 |
言語 | Standard ML (MLton 20210117) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 630 bytes |
コンパイル時間 | 5,011 ms |
コンパイル使用メモリ | 689,784 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-10-03 08:48:02 |
合計ジャッジ時間 | 4,950 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
コンパイルメッセージ
Warning: main.sml 15.13-17.44. Function is not exhaustive. missing pattern: :: ((#"\^@" .. #"l" | #"n" .. #"\255", _) | (#"m", :: (#"\^@" .. #"h" | #"j" .. #"\255", _)) | (#"m", nil)) in: fun count nil = 0 | count (#"m" : ... st.tl (skipBar tl)))
ソースコード
fun readStr () = let fun scan reader stream = SOME (StringCvt.splitl (not o Char.isSpace) reader (StringCvt.skipWS reader stream)) in valOf (TextIO.scanStream scan TextIO.stdIn) end fun findAns s = let fun skipBar nil = nil | skipBar (#"-" :: tl) = skipBar tl | skipBar l = l fun count nil = 0 | count (#"m" :: #"i" :: tl) = 1 + count (List.tl (skipBar tl)) in count (String.explode s) end val () = let val s = readStr () val ans = findAns s in print (Int.toString ans ^ "\n") end