結果
| 問題 | No.791 うし数列 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-06-15 20:12:19 | 
| 言語 | OCaml (5.2.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 255 bytes | 
| コンパイル時間 | 279 ms | 
| コンパイル使用メモリ | 21,444 KB | 
| 実行使用メモリ | 6,816 KB | 
| 最終ジャッジ日時 | 2024-10-09 01:16:43 | 
| 合計ジャッジ時間 | 981 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 14 WA * 1 | 
ソースコード
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' then (-1) else loop 1) |> Printf.printf "%d\n"
)
            
            
            
        