結果
問題 | No.791 うし数列 |
ユーザー |
|
提出日時 | 2020-06-15 20:13:29 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 264 bytes |
コンパイル時間 | 218 ms |
コンパイル使用メモリ | 21,572 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 01:16:49 |
合計ジャッジ時間 | 792 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
Scanf.scanf "%s" (fun s -> let n = String.length s in let rec loop i = if i = n then i - 1 else if s.[i] = '3' then loop (i + 1) else (-1) in (if s.[0] <> '1' || n < 2 then (-1) else loop 1) |> Printf.printf "%d\n" )