結果

問題 No.791 うし数列
ユーザー taktak
提出日時 2019-02-22 21:26:31
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 295 bytes
コンパイル時間 5,616 ms
コンパイル使用メモリ 160,440 KB
実行使用メモリ 26,092 KB
最終ジャッジ日時 2023-08-16 15:25:01
合計ジャッジ時間 6,633 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
25,936 KB
testcase_01 AC 61 ms
25,876 KB
testcase_02 AC 58 ms
24,140 KB
testcase_03 AC 59 ms
25,936 KB
testcase_04 AC 57 ms
24,160 KB
testcase_05 AC 59 ms
23,900 KB
testcase_06 AC 59 ms
24,024 KB
testcase_07 WA -
testcase_08 AC 58 ms
23,984 KB
testcase_09 AC 60 ms
26,072 KB
testcase_10 AC 60 ms
26,092 KB
testcase_11 AC 60 ms
25,964 KB
testcase_12 AC 57 ms
23,872 KB
testcase_13 AC 58 ms
25,856 KB
testcase_14 AC 58 ms
23,820 KB
testcase_15 AC 57 ms
23,868 KB
testcase_16 AC 58 ms
23,928 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
  else -1

let N = Console.ReadLine()

solve N
|> Console.WriteLine
0