记录详情

Compile Error

[1 of 1] Compiling Main             ( /in/foo.hs, /tmp/Main.o )

/in/foo.hs:1:19: error:
    * Couldn't match expected type `[b0] -> [b0] -> t1'
                  with actual type `[a0]'
    * The function `solve' is applied to two arguments,
      but its type `[a0]' has none
      In the expression: solve (n - p) p
      In the first argument of `(.)', namely `(\ n p -> solve (n - p) p)'
    * Relevant bindings include
        p :: [b0] (bound at /in/foo.hs:1:16)
        n :: [b0] (bound at /in/foo.hs:1:14)

/in/foo.hs:2:9: error:
    * Couldn't match expected type `[a]'
                  with actual type `t0 -> Integer -> [Integer]'
    * In an equation for `main':
          main
            = print . (\ n p -> solve (n - p) p) . map read . words =<< getLine
            where
                solve x y = y : zipWith (+) (tail solve x y) [y .. ]
    * Relevant bindings include solve :: [a] (bound at /in/foo.hs:2:9)

/in/foo.hs:2:32: error:
    * Couldn't match expected type `t0 -> Integer -> [Integer]'
                  with actual type `[a]'
    * The function `tail' is applied to three arguments,
      but its type `[a] -> [a]' has only one
      In the second argument of `zipWith', namely `(tail solve x y)'
      In the second argument of `(:)', namely
        `zipWith (+) (tail solve x y) [y .. ]'
    * Relevant bindings include
        x :: t0 (bound at /in/foo.hs:2:15)
        solve :: [a] (bound at /in/foo.hs:2:9)

信息

递交者
类型
自测
题目
平面分割(surface.pas/c/cpp)
语言
Haskell
递交时间
2017-11-27 12:57:33
评测时间
2019-01-10 22:28:40
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes