結果

問題 No.791 うし数列
ユーザー taktak
提出日時 2019-02-22 21:32:35
言語 F#
(F# 4.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 3,811 ms
コンパイル使用メモリ 158,936 KB
実行使用メモリ 23,904 KB
最終ジャッジ日時 2023-08-16 15:51:50
合計ジャッジ時間 5,730 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
19,796 KB
testcase_01 AC 55 ms
21,784 KB
testcase_02 AC 55 ms
23,848 KB
testcase_03 AC 54 ms
19,804 KB
testcase_04 AC 52 ms
21,796 KB
testcase_05 AC 54 ms
21,976 KB
testcase_06 AC 54 ms
19,820 KB
testcase_07 AC 54 ms
21,912 KB
testcase_08 AC 53 ms
23,828 KB
testcase_09 AC 55 ms
23,904 KB
testcase_10 AC 55 ms
21,840 KB
testcase_11 AC 55 ms
23,760 KB
testcase_12 AC 52 ms
19,844 KB
testcase_13 AC 53 ms
23,900 KB
testcase_14 AC 53 ms
21,812 KB
testcase_15 AC 53 ms
21,844 KB
testcase_16 AC 52 ms
19,864 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let solve (n: string) =
  let f = n.Substring(0, 1)
  let e = n.Substring(1)
  let ea = e.ToCharArray()
  let el = ea |> Array.length
  if f = "1" && (ea |> Array.forall((=) '3')) && (el > 0) then
    ea |> Array.length
  else -1

let N = Console.ReadLine()

solve N
|> Console.WriteLine
0