Submission #856778


Source Code Expand

Copy
namespace DotNetLab.Fs.Console

open System
open System.Collections.Generic

[<AutoOpen>]
module Misc =
  type Long = int64
  let inline long x = int64 x

  let readLine f = Console.ReadLine().Split([|' '|]) |> Array.map f

  let combinationSums xs =
    let rec loop (s, n) i =
      seq {
        if i = (xs |> Array.length) then
          yield (s, n)
        else
          yield! loop (s, n) (i + 1)
          yield! loop (s + xs.[i], n + 1.0) (i + 1)
      }
    in
      loop (0.0, 0.0) 0

  let count pred xs =
    let mutable k = 0L
    for x in xs do
      if pred x then k <- k + 1L
    k

module Program =
  [<EntryPoint>]
  let main _ =
    let [|_; a|] = readLine float
    let xs = readLine float

    let count =
      xs |> combinationSums |> count (fun (s, n) -> (s / n) = a)

    printfn "%d" count

    // exit code
    0

Submission Info

Submission Time
Task C - Tak and Cards
User vain0
Language F# (Mono 4.0)
Score 200
Code Size 885 Byte
Status TLE
Exec Time 2106 ms
Memory 7848 KB

Compile Error

/imojudge/Main.fs(34,9): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _|]' may indicate a case not covered by the pattern(s).

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 200 / 200 0 / 100
Status
AC × 3
TLE × 1
AC × 12
AC × 12
TLE × 12
Set Name Test Cases
Sample example_01.txt, example_02.txt, example_03.txt, example_04.txt
Subtask1 example_01.txt, example_02.txt, example_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt
All example_01.txt, example_02.txt, example_03.txt, example_04.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt
Case Name Status Exec Time Memory
example_01.txt AC 74 ms 3796 KB
example_02.txt AC 72 ms 3668 KB
example_03.txt AC 69 ms 3796 KB
example_04.txt TLE 2106 ms 6956 KB
subtask1_01.txt AC 139 ms 7844 KB
subtask1_02.txt AC 136 ms 7848 KB
subtask1_03.txt AC 141 ms 7844 KB
subtask1_04.txt AC 139 ms 7844 KB
subtask1_05.txt AC 136 ms 7844 KB
subtask1_06.txt AC 72 ms 3668 KB
subtask1_07.txt AC 71 ms 3668 KB
subtask1_08.txt AC 142 ms 7844 KB
subtask1_09.txt AC 108 ms 7748 KB
subtask2_01.txt TLE 2106 ms 6968 KB
subtask2_02.txt TLE 2106 ms 6960 KB
subtask2_03.txt TLE 2106 ms 6960 KB
subtask2_04.txt TLE 2106 ms 6956 KB
subtask2_05.txt TLE 2106 ms 6964 KB
subtask2_06.txt TLE 2106 ms 6960 KB
subtask2_07.txt TLE 2106 ms 6960 KB
subtask2_08.txt TLE 2106 ms 6960 KB
subtask2_09.txt TLE 2106 ms 6964 KB
subtask2_10.txt TLE 2106 ms 6964 KB
subtask2_11.txt TLE 2106 ms 6964 KB