結果

問題 No.791 うし数列
ユーザー taktak
提出日時 2019-02-22 21:27:58
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 4,507 ms
コンパイル使用メモリ 158,596 KB
実行使用メモリ 27,996 KB
最終ジャッジ日時 2023-08-16 15:29:15
合計ジャッジ時間 5,115 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
23,908 KB
testcase_01 AC 53 ms
23,948 KB
testcase_02 WA -
testcase_03 AC 51 ms
25,888 KB
testcase_04 AC 51 ms
25,820 KB
testcase_05 AC 54 ms
24,020 KB
testcase_06 AC 54 ms
24,036 KB
testcase_07 WA -
testcase_08 AC 52 ms
21,816 KB
testcase_09 AC 55 ms
24,004 KB
testcase_10 AC 53 ms
23,952 KB
testcase_11 AC 53 ms
23,948 KB
testcase_12 AC 50 ms
24,168 KB
testcase_13 AC 52 ms
25,996 KB
testcase_14 AC 53 ms
24,028 KB
testcase_15 AC 53 ms
27,996 KB
testcase_16 AC 52 ms
21,912 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
  let edl = ea |> Array.distinct |> Array.length

  if f = "1" && edl = 1 then el
  elif f = "1" && edl = 0 then 1
  else -1

let N = Console.ReadLine()

solve N
|> Console.WriteLine
0