結果

問題 No.796 well known
ユーザー chike_pluschike_plus
提出日時 2019-04-08 09:13:45
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 623 bytes
コンパイル時間 6,553 ms
コンパイル使用メモリ 164,348 KB
実行使用メモリ 73,636 KB
最終ジャッジ日時 2023-09-26 22:58:49
合計ジャッジ時間 15,109 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
25,204 KB
testcase_01 AC 115 ms
25,108 KB
testcase_02 AC 115 ms
25,124 KB
testcase_03 AC 115 ms
27,268 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let ``No.796 well known``() =
  stdin.ReadLine()
  |> int
  |> fun arg ->
    let rand = System.Random ( System.DateTime.Now.Millisecond )

    let rec factList l = 
      match l with
      | [] -> 0m
      | [x]   -> x
      | x::xs -> x * factList xs

    let rec loop n = 
      let l = 
        seq {for i in  [1..n] do yield rand.Next(312456 / n) |> decimal }
        |> Seq.toList

      if  (l |> List.sum) % 3m = 1m  && (l |> factList ) % 3m = 0m
        then l
        else loop n

    loop arg
    |> Seq.iter (fun s -> s |> stdout.Write ; stdout.Write " ") 
    stdout.WriteLine ""

  ()
``No.796 well known``()
0