結果

問題 No.791 うし数列
ユーザー chike_pluschike_plus
提出日時 2019-03-28 18:32:31
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 7,090 ms
コンパイル使用メモリ 186,820 KB
実行使用メモリ 31,872 KB
最終ジャッジ日時 2024-04-21 10:16:30
合計ジャッジ時間 8,976 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
31,616 KB
testcase_01 AC 52 ms
31,744 KB
testcase_02 AC 51 ms
31,740 KB
testcase_03 AC 50 ms
31,740 KB
testcase_04 AC 60 ms
31,744 KB
testcase_05 AC 52 ms
31,616 KB
testcase_06 AC 50 ms
31,732 KB
testcase_07 AC 53 ms
31,740 KB
testcase_08 AC 60 ms
31,744 KB
testcase_09 AC 50 ms
31,596 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 61 ms
31,744 KB
testcase_13 AC 61 ms
31,744 KB
testcase_14 AC 61 ms
31,488 KB
testcase_15 AC 61 ms
31,616 KB
testcase_16 AC 61 ms
31,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (310 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

let ``No.791 うし数列``() =

  let s = stdin.ReadLine()
  if not (s.StartsWith("1") && s.EndsWith("3"))
    then -1
    else s
         |> Seq.countBy (fun c -> c)
         |> fun arg ->
          if  Seq.length arg > 2 
            then -1
            else arg 
                |> Seq.find (fun (k , v) -> '3' = k )
                |> fun t -> snd(t)
  |> stdout.WriteLine              
  ()
``No.791 うし数列``()
0