結果

問題 No.791 うし数列
ユーザー taktak
提出日時 2019-02-22 21:31:31
言語 F#
(.NET 7)
結果
WA  
実行時間 -
コード長 258 bytes
コンパイル時間 4,377 ms
コンパイル使用メモリ 159,056 KB
実行使用メモリ 24,044 KB
最終ジャッジ日時 2023-08-16 15:46:36
合計ジャッジ時間 6,269 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
21,788 KB
testcase_01 AC 54 ms
21,812 KB
testcase_02 WA -
testcase_03 AC 54 ms
21,892 KB
testcase_04 AC 52 ms
21,740 KB
testcase_05 AC 54 ms
21,800 KB
testcase_06 AC 55 ms
21,892 KB
testcase_07 AC 55 ms
21,944 KB
testcase_08 AC 53 ms
19,804 KB
testcase_09 AC 55 ms
21,848 KB
testcase_10 AC 55 ms
21,828 KB
testcase_11 AC 55 ms
21,808 KB
testcase_12 AC 53 ms
19,868 KB
testcase_13 AC 52 ms
21,888 KB
testcase_14 AC 53 ms
23,784 KB
testcase_15 AC 53 ms
21,740 KB
testcase_16 AC 52 ms
23,796 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()
  if f = "1" && (ea |> Array.forall((=) '3')) then
    ea |> Array.length
  else -1

let N = Console.ReadLine()

solve N
|> Console.WriteLine
0